|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
java.lang.Objectjavax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.FileCacheImageInputStream
public class FileCacheImageInputStream
일반적으로의 InputStream 로부터 입력을 취득하는 ImageInputStream 의 구현입니다. 파일은, 이전에 읽어들인 데이터의 캐쉬로서 사용됩니다.
| 필드의 개요 |
|---|
| 클래스 javax.imageio.stream. ImageInputStreamImpl 로부터 상속된 필드 |
|---|
bitOffset , byteOrder , flushedPos , streamPos |
| 생성자 의 개요 | |
|---|---|
FileCacheImageInputStream (InputStream stream,
File cacheDir)
지정된 InputStream 로부터 읽어들이는 FileCacheImageInputStream 를 구축합니다. |
|
| 메소드의 개요 | |
|---|---|
void |
close ()
이 FileCacheImageInputStream 를 닫습니다. |
protected void |
finalize ()
가베지 컬렉션의 전에 이 객체를 finalize 합니다. |
boolean |
isCached ()
후방에의 시크를 가능하게 하기 위해서, 이 ImageInputStream 가 데이터를 캐쉬하기 위해(때문에),true 가 돌려주어집니다. |
boolean |
isCachedFile ()
이 ImageInputStream 는 파일 캐쉬를 유지하기 위해(때문에),true 가 돌려주어집니다. |
boolean |
isCachedMemory ()
이 ImageInputStream 는 메인 메모리 캐쉬를 유지하지 않기 때문에,false 가 돌려주어집니다. |
int |
read ()
스트림로부터 1 바이트를 읽어들여, 그것을 0 에서 255 까지의 int 로서 돌려줍니다. |
int |
read (byte[] b,
int off,
int len)
스트림로부터 len 바이트까지 읽어들여,b 에 인덱스 off 로부터 포함합니다. |
| 클래스 javax.imageio.stream. ImageInputStreamImpl 로부터 상속된 메소드 |
|---|
checkClosed , flush , flushBefore , getBitOffset , getByteOrder , getFlushedPosition , getStreamPosition , length , mark , read , readBit , readBits , readBoolean , readByte , readBytes , readChar , readDouble , readFloat , readFully , readFully , readFully , readFully , readFully , readFully , readFully , readFully , readInt , readLine , readLong , readShort , readUnsignedByte , readUnsignedInt , readUnsignedShort , readUTF , reset , seek , setBitOffset , setByteOrder , skipBytes , skipBytes |
| 클래스 java.lang. Object 로부터 상속된 메소드 |
|---|
clone , equals , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| 생성자 의 상세 |
|---|
public FileCacheImageInputStream(InputStream stream,
File cacheDir)
throws IOException
InputStream 로부터 읽어들이는 FileCacheImageInputStream 를 구축합니다.
임시 파일이 캐쉬로서 사용됩니다. cacheDir 가 null 는 아니고, 디렉토리인 경우, 파일이 거기에 작성됩니다. null 의 경우, 시스템 고유의 디폴트 임시 파일 디렉토리가 사용됩니다. 자세한 것은 File.createTempFile 의 문서를 참조해 주세요.
stream - read원의 InputStreamcacheDir - 캐쉬 파일이 작성되는 장소를 나타내는 File.
시스템 디렉토리를 사용하는 경우는
null
IllegalArgumentException - stream 가
null 의 경우
IllegalArgumentException - cacheDir 가
null 이외이지만, 디렉토리가 아닌 경우
IOException - 캐쉬 파일을 작성할 수 없는 경우| 메소드의 상세 |
|---|
public int read()
throws IOException
ImageInputStreamImpl 의 기술:int 로서 돌려줍니다. EOF 에 이르면(자) -1 를 돌려줍니다.
서브 클래스에서 이 메소드를 구현할 필요가 있습니다. 서브 클래스 구현으로 종료하기 전에 스트림 위치를 갱신합니다.
스트림내의 비트 오프셋(offset)는, read를 실시하기 전에 0 에 리셋 할 필요가 있습니다.
ImageInputStream 내의 read ImageInputStreamImpl 내의 read -1
IOException - 스트림이 닫혀지고 있는 경우
public int read(byte[] b,
int off,
int len)
throws IOException
ImageInputStreamImpl 의 기술:len 바이트까지 읽어들여,b 에 인덱스 off 로부터 포함합니다. 읽어들인 바이트수를 돌려줍니다. 스트림의 끝에 이르렀기 때문에 바이트를 읽어들일 수 없는 경우는,-1 을 돌려줍니다.
스트림내의 비트 오프셋(offset)는, read를 실시하기 전에 0 에 리셋 할 필요가 있습니다.
서브 클래스에서 이 메소드를 구현할 필요가 있습니다. 서브 클래스 구현으로 종료하기 전에 스트림 위치를 갱신합니다.
ImageInputStream 내의 read ImageInputStreamImpl 내의 read b - 기입해지는 바이트 배열off - 기입처의 b 내의 개시 위치len - 읽어들이는 최대 바이트수
-1
IOException - 입출력 에러가 발생했을 경우public boolean isCached()
ImageInputStream 가 데이터를 캐쉬하기 위해(때문에),true 가 돌려주어집니다.
ImageInputStream 내의 isCached ImageInputStreamImpl 내의 isCached trueisCachedMemory() ,
isCachedFile() public boolean isCachedFile()
ImageInputStream 는 파일 캐쉬를 유지하기 위해(때문에),true 가 돌려주어집니다.
ImageInputStream 내의 isCachedFile ImageInputStreamImpl 내의 isCachedFile trueisCached() ,
isCachedMemory() public boolean isCachedMemory()
ImageInputStream 는 메인 메모리 캐쉬를 유지하지 않기 때문에,false 가 돌려주어집니다.
ImageInputStream 내의 isCachedMemory ImageInputStreamImpl 내의 isCachedMemory falseisCached() ,
isCachedFile()
public void close()
throws IOException
FileCacheImageInputStream 을 닫습니다. 캐쉬 파일은 닫혀져 삭제됩니다. 소스 InputStream 는 닫혀지지 않습니다.
ImageInputStream 내의 close ImageInputStreamImpl 내의 close IOException - 에러가 발생했을 경우
protected void finalize()
throws Throwable
close 메소드를 호출해, 열려 있는 입력 소스를 모두 닫습니다. 이 메소드를, 어플리케이션 코드로부터 호출해서는 안됩니다.
ImageInputStreamImpl 내의 finalize Throwable - 슈퍼 클래스의 finalize시에 에러가 발생했을 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.