|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.util.zip.Inflater
public class Inflater
ÀÌ Å¬·¡½º´Â ÀϹÝÀûÀÎ ZLIB ¾ÐÃà ¶óÀ̺귯¸®¸¦ »ç¿ëÇØ ¹ü¿ëÀÇ ¾ÐÃà ÇØÁ¦¸¦ Áö¿ø ÇÕ´Ï´Ù. ZLIB ¾ÐÃà ¶óÀ̺귯¸®´Â ´çÃÊ PNG ±×·¡ÇÈ Ç¥ÁØÀÇ ÀϺημ °³¹ßµÈ °ÍÀ¸·Î ƯÇã·Î´Â º¸È£µÇÁö ¾Ê½À´Ï´Ù. »ç¾çÀÇÀÚ¼¼ÇÑ ³»¿ëÀº ¡¸ÆÐŰÁö java.util.zip ¼³¸í¡¹À» ÂüÁ¶ÇϽʽÿÀ.
ÀÌÇÏ¿¡ Deflater ¹× Inflater¸¦ »ç¿ëÇØ ij¸¯ÅÍ ¶óÀÎÀ» ¾ó¸¶Àΰ¡ ¾ÐÃà ¹× ¾ÐÃà ÇØÁ¦ÇÏ´Â Äڵ带 ³ªÅ¸³À´Ï´Ù.
// Encode a String into bytes String inputString = "blahblahblah??"; byte[] input = inputString.getBytes("UTF-8"); // Compress the bytes byte[] output = new byte[100]; Deflater compresser = new Deflater(); compresser.setInput(input); compresser.finish(); int compressedDataLength = compresser.deflate(output); // Decompress the bytes Inflater decompresser = new Inflater(); decompresser.setInput(output, 0, compressedDataLength); byte[] result = new byte[100]; int resultLength = decompresser.inflate(result); decompresser.end(); // Decode the bytes into a String String outputString = new String(result, 0, resultLength, "UTF-8");
Deflater
»ý¼ºÀÚ °³¿ä | |
---|---|
Inflater ()
»õ·Î¿î µ¥ÄÜÇÁ·¿»ç¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
|
Inflater (boolean nowrap)
»õ·Î¿î µ¥ÄÜÇÁ·¿»ç¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
void |
end ()
µ¥ÄÜÇÁ·¿»ç¸¦ ´Ý¾Æ ¾ÐÃà ÇØÁ¦µÈ ÀÔ·ÂÀ» ¸ðµÎ ÆÄ±âÇÕ´Ï´Ù. |
protected void |
finalize ()
°¡ºñÁö Ä÷º¼ÇÀ» ÇßÀ» ¶§¿¡ µ¥ÄÜÇÁ·¿»ç¸¦ ´Ý½À´Ï´Ù. |
boolean |
finished ()
¾ÐÃà µ¥ÀÌÅÍ ½ºÆ®¸²ÀÇ ¸¶Áö¸·¿¡ ´ÞÇßÀ» °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getAdler ()
¾ÐÃà ÇØÁ¦ µ¥ÀÌÅÍÀÇ ADLER-32 Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
long |
getBytesRead ()
Áö±Ý±îÁö ÀԷµÈ, ¾ÐÃàµÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
long |
getBytesWritten ()
Áö±Ý±îÁö Ãâ·ÂµÈ, ¾ÐÃà ÇØÁ¦µÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getRemaining ()
ÀÔ·Â ¹öÆÛ¿¡ ³²¾Æ ÀÖ´Â ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getTotalIn ()
Áö±Ý±îÁö ÀԷµÈ, ¾ÐÃàµÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getTotalOut ()
Áö±Ý±îÁö Ãâ·ÂµÈ, ¾ÐÃà ÇØÁ¦µÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
inflate (byte[] b)
ÁöÁ¤µÈ ¹öÆÛ¿¡ ¹ÙÀÌÆ®¸¦ ¾ÐÃà ÇØÁ¦ÇÕ´Ï´Ù. |
int |
inflate (byte[] b,
int off,
int len)
ÁöÁ¤µÈ ¹öÆÛ¿¡ ¹ÙÀÌÆ®¸¦ ¾ÐÃà ÇØÁ¦ÇÕ´Ï´Ù. |
boolean |
needsDictionary ()
pre-set µñ¼î³»¸®°¡ ¾ÐÃà ÇØÁ¦¿¡ ÇÊ¿äÇÑ °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
needsInput ()
ÀÔ·Â ¹öÆÛ¿¡ µ¥ÀÌÅͰ¡ ³²Áö ¾ÊÀº °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
reset ()
»õ·Î¿î ÀÔ·Â µ¥ÀÌÅÍ ¼¼Æ®¸¦ ó¸®ÇÒ ¼ö ÀÖµµ·Ï ÀÎÇ÷¹ÀÌÅ͸¦ ¸®¼Â ÇÕ´Ï´Ù. |
void |
setDictionary (byte[] b)
pre-set µñ¼î³»¸®¸¦ ÁöÁ¤ÀÇ ¹ÙÀÌÆ® ¹è¿·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setDictionary (byte[] b,
int off,
int len)
pre-set µñ¼î³»¸®¸¦ ÁöÁ¤ÀÇ ¹ÙÀÌÆ® ¹è¿·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setInput (byte[] b)
¾ÐÃà ÇØÁ¦¸¦ À§ÇÑ ÀÔ·Â µ¥ÀÌÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setInput (byte[] b,
int off,
int len)
¾ÐÃà ÇØÁ¦¸¦ À§ÇÑ ÀÔ·Â µ¥ÀÌÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public Inflater(boolean nowrap)
ÁÖ: nowrap ¿É¼ÇÀ» »ç¿ëÇÏ´Â °æ¿ì´Â ÀÔ·ÂÀ¸·Î¼ Ưº°ÇÑ ¡¸´õ¹Ì¡¹¹ÙÀÌÆ®¸¦ ÁöÁ¤ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. À̰ÍÀº ÃÖÀûȸ¦ ½Ç½ÃÇϱâ À§Çؼ ZLIB ³×ÀÌÆ¼ºê ¶óÀ̺귯¸®¿¡¼ ÇÊ¿äÇÕ´Ï´Ù.
nowrap
- trueÀÎ °æ¿ì´Â GZIP ȣȯÀÇ ¾ÐÃàÀ» Áö¿ø
public Inflater()
¸Þ¼µåÀÇ »ó¼¼ |
---|
public void setInput(byte[] b, int off, int len)
b
- ÀÔ·Â µ¥ÀÌÅÍ ¹ÙÀÌÆ®off
- ÀÔ·Â µ¥ÀÌÅÍÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)len
- ÀÔ·Â µ¥ÀÌÅÍÀÇ ±æÀÌneedsInput()
public void setInput(byte[] b)
b
- ÀÔ·Â µ¥ÀÌÅÍ ¹ÙÀÌÆ®needsInput()
public void setDictionary(byte[] b, int off, int len)
b
- µñ¼î³»¸® µ¥ÀÌÅÍ ¹ÙÀÌÆ®off
- µ¥ÀÌÅÍÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)len
- µ¥ÀÌÅÍÀÇ ±æÀÌneedsDictionary()
,
getAdler()
public void setDictionary(byte[] b)
b
- µñ¼î³»¸® µ¥ÀÌÅÍ ¹ÙÀÌÆ®needsDictionary()
,
getAdler()
public int getRemaining()
public boolean needsInput()
public boolean needsDictionary()
setDictionary(byte[], int, int)
public boolean finished()
public int inflate(byte[] b, int off, int len) throws DataFormatException
b
- ¾ÐÃà ÇØÁ¦µÇ´Â µ¥ÀÌÅÍ¿ëÀÇ ¹öÆÛoff
- µ¥ÀÌÅÍÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)len
- ¾ÐÃà ÇØÁ¦µÇ´Â ÃÖ´ë ¹ÙÀÌÆ®¼ö
DataFormatException
- ¾ÐÃà µ¥ÀÌÅÍ Çü½ÄÀÌ ¹«È¿ÀÎ °æ¿ìneedsInput()
,
needsDictionary()
public int inflate(byte[] b) throws DataFormatException
b
- ¾ÐÃà ÇØÁ¦µÇ´Â µ¥ÀÌÅÍ¿ëÀÇ ¹öÆÛ
DataFormatException
- ¾ÐÃà µ¥ÀÌÅÍ Çü½ÄÀÌ ¹«È¿ÀÎ °æ¿ìneedsInput()
,
needsDictionary()
public int getAdler()
public int getTotalIn()
¹ÙÀÌÆ®¼ö´Â Integer.MAX_VALUE º¸´Ù Ä¿Áö´Â °æ¿ì°¡ Àֱ⠶§¹®¿¡
ÀÌ Á¤º¸¸¦ ¾ò´Â °æ¿ì´Â getBytesRead()
¸Þ¼µåÀÇ (ºÐ)ÆíÀ» ¿ì¼±ÀûÀ¸·Î »ç¿ëÇØ ÁÖ¼¼¿ä.
public long getBytesRead()
public int getTotalOut()
¹ÙÀÌÆ®¼ö´Â Integer.MAX_VALUE º¸´Ù Ä¿Áö´Â °æ¿ì°¡ Àֱ⠶§¹®¿¡
ÀÌ Á¤º¸¸¦ ¾ò´Â °æ¿ì´Â getBytesWritten()
¸Þ¼µåÀÇ (ºÐ)ÆíÀ» ¿ì¼±ÀûÀ¸·Î »ç¿ëÇØ ÁÖ¼¼¿ä.
public long getBytesWritten()
public void reset()
public void end()
protected void finalize()
Object
³»ÀÇ finalize
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.