JavaTM Platform
Standard Ed. 6

javax.imageio.stream
클래스 MemoryCacheImageOutputStream

java.lang.Object 
  상위를 확장 javax.imageio.stream.ImageInputStreamImpl 
      상위를 확장 javax.imageio.stream.ImageOutputStreamImpl 
          상위를 확장 javax.imageio.stream.MemoryCacheImageOutputStream
모든 구현된 인터페이스:
DataInput , DataOutput , ImageInputStream , ImageOutputStream


public class MemoryCacheImageOutputStream
extends ImageOutputStreamImpl

출력을 일반적으로의 OutputStream 에 기입하는 ImageOutputStream 의 구현입니다. 메모리밧파에는, 적어도 파기 위치와 현재의 기입 위치와의 사이의 데이터가 캐쉬됩니다. OutputStream 를 사용하는 것은 생성자 만이므로, 이 클래스는 읽어들여, 변경, 또는 기입해 조작에 사용할 수 없는 경우가 있습니다. read는, 캐쉬에 기입이 끝난 상태로 아직 플래시되어 있지 않은 스트림 부분에 대한 보고 실시할 수가 있습니다.


필드의 개요
 
클래스 javax.imageio.stream. ImageInputStreamImpl 로부터 상속된 필드
bitOffset , byteOrder , flushedPos , streamPos
 
생성자 의 개요
MemoryCacheImageOutputStream (OutputStream  stream)
          지정된 outputStream 에 기입하는 MemoryCacheImageOutputStream 를 구축합니다.
 
메소드의 개요
 void close ()
          이 MemoryCacheImageOutputStream 를 닫습니다.
 void flushBefore (long pos)
          지시받은 위치보다 전의 초기의 스트림 부분을 파기합니다.
 boolean isCached ()
          후방에의 시크를 가능하게 하기 위해서, 이 ImageOutputStream 가 데이터를 캐쉬하기 위해(때문에),true 가 돌려주어집니다.
 boolean isCachedFile ()
          이 mageOutputStream 는 파일 캐쉬를 유지하지 않기 때문에,false 가 돌려주어집니다.
 boolean isCachedMemory ()
          이 ImageOutputStream 는 메인 메모리 캐쉬를 유지하기 위해(때문에),true 가 돌려주어집니다.
 long length ()
          스트림이 미지의 길이인 것을 나타낸다 -1L 를 돌려줍니다.
 int read ()
          스트림로부터 1 바이트를 읽어들여, 그것을 0 에서 255 까지의 int 로서 돌려줍니다.
 int read (byte[] b, int off, int len)
          스트림로부터 len 바이트까지 읽어들여,b 에 인덱스 off 로부터 포함합니다.
 void write (byte[] b, int off, int len)
          바이트의 순서를 스트림의 현재 위치에 기입합니다.
 void write (int b)
          스트림의 현재의 위치에 1 바이트 기입합니다.
 
클래스 javax.imageio.stream. ImageOutputStreamImpl 로부터 상속된 메소드
flushBits , write , writeBit , writeBits , writeBoolean , writeByte , writeBytes , writeChar , writeChars , writeChars , writeDouble , writeDoubles , writeFloat , writeFloats , writeInt , writeInts , writeLong , writeLongs , writeShort , writeShorts , writeUTF
 
클래스 javax.imageio.stream. ImageInputStreamImpl 로부터 상속된 메소드
checkClosed , finalize , flush , getBitOffset , getByteOrder , getFlushedPosition , getStreamPosition , 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
 
인터페이스 javax.imageio.stream. ImageInputStream 로부터 상속된 메소드
flush , getBitOffset , getByteOrder , getFlushedPosition , getStreamPosition , 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
 

생성자 의 상세

MemoryCacheImageOutputStream

public MemoryCacheImageOutputStream(OutputStream  stream)
지정된 outputStream 에 기입하는 MemoryCacheImageOutputStream 를 구축합니다.

파라미터:
stream - 기입처의 OutputStream
예외:
IllegalArgumentException - streamnull 의 경우
메소드의 상세

read

public int read()
         throws IOException 
클래스 ImageInputStreamImpl 의 기술:
스트림로부터 1 바이트를 읽어들여, 그것을 0 에서 255 까지의 int 로서 돌려줍니다. EOF 에 이르면(자) -1 를 돌려줍니다.

서브 클래스에서 이 메소드를 구현할 필요가 있습니다. 서브 클래스 구현으로 종료하기 전에 스트림 위치를 갱신합니다.

스트림내의 비트 오프셋(offset)는, read를 실시하기 전에 0 에 리셋 할 필요가 있습니다.

정의:
인터페이스 ImageInputStream 내의 read
정의:
클래스 ImageInputStreamImpl 내의 read
반환값:
스트림내의 다음의 바이트의 값. 또는, EOF 에 이르렀을 경우는 -1
예외:
IOException - 스트림이 닫혀지고 있는 경우

read

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 - 읽어들이는 최대 바이트수
반환값:
실제로 읽힌 바이트수, 또는 EOF 를 나타낸다 -1
예외:
IOException - 입출력 에러가 발생했을 경우

write

public void write(int b)
           throws IOException 
인터페이스 ImageOutputStream 의 기술:
스트림의 현재의 위치에 1 바이트 기입합니다. b 의 상위 24 비트는 무시됩니다.

스트림내의 비트 오프셋(offset)가 제로가 아닌 경우, 현재의 바이트의 나머지는 0 으로 패딩 되어 최초로 기입해집니다. 기입 후는, 비트 오프셋(offset)는 0 입니다. 구현측은,ImageOutputStreamImplflushBits 메소드를 사용해 이것을 보증할 수 있습니다.

정의:
인터페이스 DataOutput 내의 write
정의:
인터페이스 ImageOutputStream 내의 write
정의:
클래스 ImageOutputStreamImpl 내의 write
파라미터:
b - 하위 8 비트가 기입해진다 int
예외:
IOException - 입출력 에러가 발생했을 경우

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException 
인터페이스 ImageOutputStream 의 기술:
바이트의 순서를 스트림의 현재 위치에 기입합니다. len 가 0 의 경우, 아무것도 기입하지 않습니다. 바이트 b[off] 를 최초로 기입해, 다음에 바이트 bo[off + 1] 을 기입한다, 라고 하는 상태가 됩니다.

스트림내의 비트 오프셋(offset)가 제로가 아닌 경우, 현재의 바이트의 나머지는 0 으로 패딩 되어 최초로 기입해집니다. 기입 후는, 비트 오프셋(offset)는 0 입니다. 구현측은,ImageOutputStreamImplflushBits 메소드를 사용해 이것을 보증할 수 있습니다.

정의:
인터페이스 DataOutput 내의 write
정의:
인터페이스 ImageOutputStream 내의 write
정의:
클래스 ImageOutputStreamImpl 내의 write
파라미터:
b - 기입해지는 byte 배열
off - 데이터의 개시 오프셋(offset)
len - 기입 byte
예외:
IOException - 입출력 에러가 발생했을 경우

length

public long length()
클래스 ImageInputStreamImpl 의 기술:
스트림이 미지의 길이인 것을 나타낸다 -1L 를 돌려줍니다. 서브 클래스에서 이 메소드를 오버라이드(override) 해, 실제의 길이의 정보를 지정할 필요가 있습니다.

정의:
인터페이스 ImageInputStream 내의 length
오버라이드(override):
클래스 ImageInputStreamImpl 내의 length
반환값:
미지의 길이를 나타낸다 -1L

isCached

public boolean isCached()
후방에의 시크를 가능하게 하기 위해서, 이 ImageOutputStream 가 데이터를 캐쉬하기 위해(때문에),true 가 돌려주어집니다.

정의:
인터페이스 ImageInputStream 내의 isCached
오버라이드(override):
클래스 ImageInputStreamImpl 내의 isCached
반환값:
true
관련 항목:
isCachedMemory() , isCachedFile()

isCachedFile

public boolean isCachedFile()
mageOutputStream 는 파일 캐쉬를 유지하지 않기 때문에,false 가 돌려주어집니다.

정의:
인터페이스 ImageInputStream 내의 isCachedFile
오버라이드(override):
클래스 ImageInputStreamImpl 내의 isCachedFile
반환값:
false
관련 항목:
isCached() , isCachedMemory()

isCachedMemory

public boolean isCachedMemory()
ImageOutputStream 는 메인 메모리 캐쉬를 유지하기 위해(때문에),true 가 돌려주어집니다.

정의:
인터페이스 ImageInputStream 내의 isCachedMemory
오버라이드(override):
클래스 ImageInputStreamImpl 내의 isCachedMemory
반환값:
true
관련 항목:
isCached() , isCachedFile()

close

public void close()
           throws IOException 
MemoryCacheImageOutputStream 를 닫습니다. 보류중의 데이터는 모두 출력에 플래시 되어 캐쉬는 해제됩니다. 출력처 OutputStream 는 닫혀지지 않습니다.

정의:
인터페이스 ImageInputStream 내의 close
오버라이드(override):
클래스 ImageInputStreamImpl 내의 close
예외:
IOException - 입출력 에러가 발생했을 경우

flushBefore

public void flushBefore(long pos)
                 throws IOException 
인터페이스 ImageInputStream 의 기술:
지시받은 위치보다 전의 초기의 스트림 부분을 파기합니다. 스트림의 플래시 된 부분내의 오프셋(offset)에 시크 하려고 하면(자),IndexOutOfBoundsException 가 throw 됩니다.

flushBefore 를 호출하면(자), 이 인터페이스를 구현하는 클래스가, 스트림로부터 데이터를 포함하는데 사용하는 메모리나 디스크 스페이스등의 자원을 해제할 수 있습니다.

정의:
인터페이스 ImageInputStream 내의 flushBefore
정의:
인터페이스 ImageOutputStream 내의 flushBefore
오버라이드(override):
클래스 ImageInputStreamImpl 내의 flushBefore
파라미터:
pos - 플래시 되는 스트림 접두사의 길이를 나타내는 long
예외:
IOException - 입출력 에러가 발생했을 경우

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.