|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.util.zip.Deflater
public class Deflater
ÀÌ Å¬·¡½º´Â ÀϹÝÀûÀÎ 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");
Inflater
ÇÊµå °³¿ä | |
---|---|
static int |
BEST_COMPRESSION
ÃÖÀûÀÎ ¾ÐÃàÀ» À§ÇÑ ¾ÐÃà ·¹º§ÀÔ´Ï´Ù. |
static int |
BEST_SPEED
ÃÖ°í¼Ó¿¡¼ÀÇ ¾ÐÃàÀ» À§ÇÑ ¾ÐÃà ·¹º§ÀÔ´Ï´Ù. |
static int |
DEFAULT_COMPRESSION
µðÆúÆ®ÀÇ ¾ÐÃà ·¹º§ÀÔ´Ï´Ù. |
static int |
DEFAULT_STRATEGY
µðÆúÆ®ÀÇ ¾ÐÃà ¹æ¹ýÀÔ´Ï´Ù. |
static int |
DEFLATED
deflate ¾Ë°í¸®ÁòÀÇ ¾ÐÃà ¸Þ¼µå (ÇöÀç Áö¿ø µÇ°í ÀÖ´Â °ÍÀº 1°³ »Ó)ÀÔ´Ï´Ù. |
static int |
FILTERED
ÀÛÀº °ªÀÌ ¾î´À Á¤µµ ·£´ý¿¡ ºÐÆ÷Çϰí ÀÖ´Â µ¥ÀÌÅÍ¿¡ ÃÖÀûÀÎ ¾ÐÃà ¹æ¹ýÀÔ´Ï´Ù. |
static int |
HUFFMAN_ONLY
ÇÏÇÁ¸Ç ÄÚµù Àü¿ëÀÇ ¾ÐÃà ¹æ¹ýÀÔ´Ï´Ù. |
static int |
NO_COMPRESSION
¾ÐÃàÇÏÁö ¾Ê´Â °æ¿ìÀÇ ¾ÐÃà ·¹º§ÀÔ´Ï´Ù. |
»ý¼ºÀÚ °³¿ä | |
---|---|
Deflater ()
µðÆúÆ®ÀÇ ¾ÐÃà ·¹º§·Î »õ·Î¿î ¾Ð·ÂÀ» ÀÛ¼ºÇÕ´Ï´Ù. |
|
Deflater (int level)
ÁöÁ¤µÈ ¾ÐÃà ·¹º§·Î »õ·Î¿î ¾Ð·ÂÀ» ÀÛ¼ºÇÕ´Ï´Ù. |
|
Deflater (int level,
boolean nowrap)
ÁöÁ¤µÈ ¾ÐÃà ·¹º§·Î »õ·Î¿î ¾Ð·ÂÀ» ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
int |
deflate (byte[] b)
ÁöÁ¤µÈ ¹öÆÛ¸¦ ¾ÐÃà µ¥ÀÌÅͷΠä¿ó´Ï´Ù. |
int |
deflate (byte[] b,
int off,
int len)
ÁöÁ¤µÈ ¹öÆÛ¸¦ ¾ÐÃà µ¥ÀÌÅͷΠä¿ó´Ï´Ù. |
void |
end ()
¾Ð·ÂÀ» ´Ý¾Æ ¾ÐÃà ÇØÁ¦µÈ ÀÔ·ÂÀ» ¸ðµÎ ÆÄ±âÇÕ´Ï´Ù. |
protected void |
finalize ()
°¡ºñÁö Ä÷º¼ÇÀ» ÇßÀ» ¶§¿¡ ¾Ð·ÂÀ» ´Ý½À´Ï´Ù. |
void |
finish ()
ÀÌ ¸Þ¼µå°¡ ºÒ·Á°¡ ¸é, ¾ÐÃàÀÌ ÀÔ·Â ¹öÆÛÀÇ ÇöÀçÀÇ ³»¿ëÀ¸·Î Á¾·áÇÒ Çʿ䰡 ÀÖ´Â °ÍÀ» ³ªÅ¸³À´Ï´Ù. |
boolean |
finished ()
¾ÐÃà µ¥ÀÌÅÍÀÇ Ãâ·Â ½ºÆ®¸²ÀÇ ¸¶Áö¸·¿¡ ´ÞÇßÀ» °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getAdler ()
¾ÐÃà ÇØÁ¦ µ¥ÀÌÅÍÀÇ ADLER-32 Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
long |
getBytesRead ()
Áö±Ý±îÁö ÀԷµÈ, ¾ÐÃà ÇØÁ¦µÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
long |
getBytesWritten ()
Áö±Ý±îÁö Ãâ·ÂµÈ, ¾ÐÃàµÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getTotalIn ()
Áö±Ý±îÁö ÀԷµÈ, ¾ÐÃà ÇØÁ¦µÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getTotalOut ()
Áö±Ý±îÁö Ãâ·ÂµÈ, ¾ÐÃàµÈ ¹ÙÀÌÆ®ÀÇ ÃѼö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
needsInput ()
ÀÔ·Â µ¥ÀÌÅÍ ¹öÆÛ°¡ ºñ¾îÀÖ¾î setInput()¸¦ È£ÃâÇØ ÀÔ·ÂÀ» Ãß°¡ÇÒ Çʿ䰡 ÀÖ´Â °æ¿ì¿¡ 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)
¾ÐÃàÀ» À§ÇÑ ÀÔ·Â µ¥ÀÌÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLevel (int level)
ÇöÀçÀÇ ¾ÐÃà ·¹º§ÀÌ ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setStrategy (int strategy)
¾ÐÃà ¹æ¹ýÀÌ ÁöÁ¤µÈ °ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
public static final int DEFLATED
public static final int NO_COMPRESSION
public static final int BEST_SPEED
public static final int BEST_COMPRESSION
public static final int DEFAULT_COMPRESSION
public static final int FILTERED
public static final int HUFFMAN_ONLY
public static final int DEFAULT_STRATEGY
»ý¼ºÀÚ »ó¼¼ |
---|
public Deflater(int level, boolean nowrap)
level
- ¾ÐÃà ·¹º§ (0 ~ 9)nowrap
- trueÀÎ °æ¿ì´Â GZIP ȣȯÀÇ ¾ÐÃàÀ» »ç¿ëpublic Deflater(int level)
level
- ¾ÐÃà ·¹º§ (0 ~ 9)public Deflater()
¸Þ¼µåÀÇ »ó¼¼ |
---|
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
- µ¥ÀÌÅÍÀÇ ±æÀÌInflater.inflate(byte[], int, int)
,
Inflater.getAdler()
public void setDictionary(byte[] b)
b
- µñ¼î³»¸® µ¥ÀÌÅÍ ¹ÙÀÌÆ®Inflater.inflate(byte[], int, int)
,
Inflater.getAdler()
public void setStrategy(int strategy)
strategy
- »õ·Î¿î ¾ÐÃà ¹æ¹ý
IllegalArgumentException
- ¾ÐÃà ¹æ¹ýÀÌ ¹«È¿ÀÎ °æ¿ìpublic void setLevel(int level)
level
- »õ·Î¿î ¾ÐÃà ·¹º§ (0 ~ 9)
IllegalArgumentException
- ¾ÐÃà ·¹º§ÀÌ ¹«È¿ÀÎ °æ¿ìpublic boolean needsInput()
public void finish()
public boolean finished()
public int deflate(byte[] b, int off, int len)
b
- ¾ÐÃà µ¥ÀÌÅÍ¿ëÀÇ ¹öÆÛoff
- µ¥ÀÌÅÍÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)len
- ¾ÐÃà µ¥ÀÌÅÍÀÇ ÃÖ´ë ¹ÙÀÌÆ®¼ö
public int deflate(byte[] b)
b
- ¾ÐÃà µ¥ÀÌÅÍ¿ëÀÇ ¹öÆÛ
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 µµ ÂüÁ¶ÇϽʽÿÀ.