ar.com.hjg.pngj
Class PngHelperInternal

java.lang.Object
  extended by ar.com.hjg.pngj.PngHelperInternal

public class PngHelperInternal
extends Object

Some utility static methods for internal use.

Client code should not normally use this class


Field Summary
static Charset charsetLatin1
          Default charset, used internally by PNG for several things
static Charset charsetUTF8
          UTF-8 is only used for some chunks
 
Constructor Summary
PngHelperInternal()
           
 
Method Summary
static int doubleToInt100000(double d)
           
static int filterRowAverage(int r, int left, int up)
           
static int filterRowNone(int r)
           
static int filterRowPaeth(int r, int left, int up, int upleft)
           
static int filterRowSub(int r, int left)
           
static int filterRowUp(int r, int up)
           
static CRC32 getCRC()
          thread-singleton crc engine
static double intToDouble100000(int i)
           
static void logdebug(String msg)
           
static int readByte(InputStream is)
           
static void readBytes(InputStream is, byte[] b, int offset, int len)
          guaranteed to read exactly len bytes. throws error if it cant
static int readInt1fromByte(byte[] b, int offset)
           
static int readInt2(InputStream is)
          -1 if eof PNG uses "network byte order"
static int readInt2fromBytes(byte[] b, int offset)
           
static int readInt4(InputStream is)
          -1 if eof
static int readInt4fromBytes(byte[] b, int offset)
           
static int unfilterRowAverage(int r, int left, int up)
           
static int unfilterRowNone(int r)
           
static int unfilterRowPaeth(int r, int left, int up, int upleft)
           
static int unfilterRowSub(int r, int left)
           
static int unfilterRowUp(int r, int up)
           
static void writeByte(OutputStream os, byte b)
           
static void writeBytes(OutputStream os, byte[] b)
           
static void writeBytes(OutputStream os, byte[] b, int offset, int n)
           
static void writeInt2(OutputStream os, int n)
           
static void writeInt2tobytes(int n, byte[] b, int offset)
           
static void writeInt4(OutputStream os, int n)
           
static void writeInt4tobytes(int n, byte[] b, int offset)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charsetLatin1

public static Charset charsetLatin1
Default charset, used internally by PNG for several things


charsetUTF8

public static Charset charsetUTF8
UTF-8 is only used for some chunks

Constructor Detail

PngHelperInternal

public PngHelperInternal()
Method Detail

doubleToInt100000

public static int doubleToInt100000(double d)

filterRowAverage

public static int filterRowAverage(int r,
                                   int left,
                                   int up)

filterRowNone

public static int filterRowNone(int r)

filterRowPaeth

public static int filterRowPaeth(int r,
                                 int left,
                                 int up,
                                 int upleft)

filterRowSub

public static int filterRowSub(int r,
                               int left)

filterRowUp

public static int filterRowUp(int r,
                              int up)

getCRC

public static CRC32 getCRC()
thread-singleton crc engine


intToDouble100000

public static double intToDouble100000(int i)

logdebug

public static void logdebug(String msg)

readByte

public static int readByte(InputStream is)

readBytes

public static void readBytes(InputStream is,
                             byte[] b,
                             int offset,
                             int len)
guaranteed to read exactly len bytes. throws error if it cant


readInt1fromByte

public static int readInt1fromByte(byte[] b,
                                   int offset)

readInt2

public static int readInt2(InputStream is)
-1 if eof PNG uses "network byte order"


readInt2fromBytes

public static int readInt2fromBytes(byte[] b,
                                    int offset)

readInt4

public static int readInt4(InputStream is)
-1 if eof


readInt4fromBytes

public static int readInt4fromBytes(byte[] b,
                                    int offset)

unfilterRowAverage

public static int unfilterRowAverage(int r,
                                     int left,
                                     int up)

unfilterRowNone

public static int unfilterRowNone(int r)

unfilterRowPaeth

public static int unfilterRowPaeth(int r,
                                   int left,
                                   int up,
                                   int upleft)

unfilterRowSub

public static int unfilterRowSub(int r,
                                 int left)

unfilterRowUp

public static int unfilterRowUp(int r,
                                int up)

writeByte

public static void writeByte(OutputStream os,
                             byte b)

writeBytes

public static void writeBytes(OutputStream os,
                              byte[] b)

writeBytes

public static void writeBytes(OutputStream os,
                              byte[] b,
                              int offset,
                              int n)

writeInt2

public static void writeInt2(OutputStream os,
                             int n)

writeInt2tobytes

public static void writeInt2tobytes(int n,
                                    byte[] b,
                                    int offset)

writeInt4

public static void writeInt4(OutputStream os,
                             int n)

writeInt4tobytes

public static void writeInt4tobytes(int n,
                                    byte[] b,
                                    int offset)