Class PICTUtil


  • final class PICTUtil
    extends java.lang.Object
    PICTUtil
    Version:
    $Id: PICTUtil.java,v 1.0 Feb 16, 2009 8:46:27 PM haraldk Exp$
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String ENC_MAC_ROMAN  
      static java.nio.charset.Charset ENCODING  
    • Constructor Summary

      Constructors 
      Constructor Description
      PICTUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.nio.charset.Charset initEncoding()  
      static Pattern readColorPattern​(java.io.DataInput pStream)
      Reads a variable width color pattern from the given stream
      static java.awt.image.IndexColorModel readColorTable​(java.io.DataInput pStream, int pPixelSize)
      Reads a ColorTable data structure from the given stream.
      static java.awt.Dimension readDimension​(java.io.DataInput pStream)
      Reads a dimension from the given stream.
      static double readFixedPoint​(java.io.DataInput pStream)
      Reads a fixed point number from the given stream.
      (package private) static java.lang.String readIdString​(java.io.DataInput pStream)  
      static java.lang.String readPascalString​(java.io.DataInput pStream)
      Reads a Pascal String from the given stream.
      static Pattern readPattern​(java.io.DataInput pStream)
      Reads a pattern from the given stream.
      static Pattern readPattern​(java.io.DataInput pStream, java.awt.Color fg, java.awt.Color bg)  
      static java.awt.Color readRGBColor​(java.io.DataInput pStream)
      Reads an RGBColor record from the given stream.
      static java.lang.String readStr31​(java.io.DataInput pStream)
      Reads a 32 byte fixed length Pascal string from the given input.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ENCODING

        public static final java.nio.charset.Charset ENCODING
    • Constructor Detail

      • PICTUtil

        PICTUtil()
    • Method Detail

      • initEncoding

        private static java.nio.charset.Charset initEncoding()
      • readFixedPoint

        public static double readFixedPoint​(java.io.DataInput pStream)
                                     throws java.io.IOException
        Reads a fixed point number from the given stream.
        Parameters:
        pStream - the input stream
        Returns:
        the number as a double.
        Throws:
        java.io.IOException - if an I/O error occurs during read
      • readIdString

        static java.lang.String readIdString​(java.io.DataInput pStream)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readDimension

        public static java.awt.Dimension readDimension​(java.io.DataInput pStream)
                                                throws java.io.IOException
        Reads a dimension from the given stream.
        Parameters:
        pStream - the input stream
        Returns:
        the dimension read
        Throws:
        java.io.IOException - if an I/O error occurs during read
      • readStr31

        public static java.lang.String readStr31​(java.io.DataInput pStream)
                                          throws java.io.IOException
        Reads a 32 byte fixed length Pascal string from the given input. The input stream must be positioned at the length byte of the text, the text will be no longer than 31 characters long.
        Parameters:
        pStream - the input stream
        Returns:
        the text read
        Throws:
        java.io.IOException - if an I/O exception occurs during reading
      • readPascalString

        public static java.lang.String readPascalString​(java.io.DataInput pStream)
                                                 throws java.io.IOException
        Reads a Pascal String from the given stream. The input stream must be positioned at the length byte of the text, which can thus be a maximum of 255 characters long.
        Parameters:
        pStream - the input stream
        Returns:
        the text read
        Throws:
        java.io.IOException - if an I/O exception occurs during reading
      • readPattern

        public static Pattern readPattern​(java.io.DataInput pStream)
                                   throws java.io.IOException
        Reads a pattern from the given stream.
        Parameters:
        pStream - the input stream
        Returns:
        the pattern read
        Throws:
        java.io.IOException - if an I/O error occurs during read
      • readPattern

        public static Pattern readPattern​(java.io.DataInput pStream,
                                          java.awt.Color fg,
                                          java.awt.Color bg)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • readColorPattern

        public static Pattern readColorPattern​(java.io.DataInput pStream)
                                        throws java.io.IOException
        Reads a variable width color pattern from the given stream
        Parameters:
        pStream - the input stream
        Returns:
        the pattern read
        Throws:
        java.io.IOException - if an I/O error occurs during read
      • readRGBColor

        public static java.awt.Color readRGBColor​(java.io.DataInput pStream)
                                           throws java.io.IOException
        Reads an RGBColor record from the given stream.
        Parameters:
        pStream - the input stream
        Returns:
        the color read
        Throws:
        java.io.IOException - if an I/O error occurs during read
      • readColorTable

        public static java.awt.image.IndexColorModel readColorTable​(java.io.DataInput pStream,
                                                                    int pPixelSize)
                                                             throws java.io.IOException
        Reads a ColorTable data structure from the given stream.
        Parameters:
        pStream - the input stream
        pPixelSize - the pixel size
        Returns:
        the indexed color model created from the ColorSpec records read.
        Throws:
        java.io.IOException - if an I/O error occurs during read