Class GraphicsCharacterString

    • Field Detail

      • MAX_STR_LEN

        protected static final int MAX_STR_LEN
        Up to 255 bytes of character data
        See Also:
        Constant Field Values
      • str

        private final java.lang.String str
        the string to draw
      • charSet

        private final CharacterSet charSet
        The character set encoding to use
    • Constructor Detail

      • GraphicsCharacterString

        public GraphicsCharacterString​(java.lang.String str,
                                       int x,
                                       int y,
                                       CharacterSet charSet)
        Constructor (absolute positioning)
        Parameters:
        str - the character string
        x - the x coordinate
        y - the y coordinate
        charSet - the character set
    • Method Detail

      • writeToStream

        public void writeToStream​(java.io.OutputStream os)
                           throws java.io.IOException
        DataStream objects must implement the writeToStream() method to write its data to the given OutputStream
        Specified by:
        writeToStream in interface Streamable
        Overrides:
        writeToStream in class AbstractGraphicsCoord
        Parameters:
        os - the outputsteam stream
        Throws:
        java.io.IOException - an I/O exception of some sort has occurred.
      • getStringAsBytes

        private byte[] getStringAsBytes()
                                 throws java.io.UnsupportedEncodingException,
                                        java.nio.charset.CharacterCodingException
        Returns the text string as an encoded byte array
        Returns:
        the text string as an encoded byte array
        Throws:
        java.io.UnsupportedEncodingException
        java.nio.charset.CharacterCodingException