APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.glass.ui.win

pack-priv Class HTMLCodec

Located in compilation unit of com.sun.glass.ui.win.WinHTMLCodec.

extends InputStream
Class Inheritance

on decode: This stream takes an InputStream which provides data in CF_HTML format, strips off the description and context to extract the original HTML data. on encode: static convertToHTMLFormat is responsible for HTML clipboard header creation

Field Summary

Modifier and TypeField and Description
private final BufferedInputStream
public static final int
public static final int
private boolean
public static final String
private boolean
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
private static final String
private long
private long
private long
private long
private long
private static final String
private long
private long
private long
private long
private static final int
private EHTMLReadMode
public static final String
public static final String
public static final String
public static final String
public static final String
private String
private String
public static final String
private static final String

Constructor Summary

AccessConstructor and Description
public
HTMLCodec(InputStream _bytestream, EHTMLReadMode _readMode)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.

public static byte[]
convertToHTMLFormat(byte[] bytes)

convertToHTMLFormat adds the MS HTML clipboard header to byte array that contains the parameters pairs.

public synchronized String
public synchronized String
private void
parseDescription()

parseDescription parsing HTML clipboard header as it described in comment to convertToHTMLFormat

public synchronized int
read()

Implements abstract java.io.InputStream.read.

Reads the next byte of data from the input stream.

private static String
toPaddedString(int n, int width)

Inherited from java.io.InputStream:
availablemarkmarkSupportednullInputStreamreadreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

bufferedStreamback to summary
private final BufferedInputStream bufferedStream
BYTE_BUFFER_LENback to summary
public static final int BYTE_BUFFER_LEN
CHAR_BUFFER_LENback to summary
public static final int CHAR_BUFFER_LEN
closedback to summary
private boolean closed
DEF_SOURCE_URLback to summary
public static final String DEF_SOURCE_URL
descriptionParsedback to summary
private boolean descriptionParsed
ENCODINGback to summary
public static final String ENCODING
END_FRAGMENTback to summary
public static final String END_FRAGMENT
END_FRAGMENT_CMTback to summary
public static final String END_FRAGMENT_CMT
END_HTMLback to summary
public static final String END_HTML
END_SELECTIONback to summary
public static final String END_SELECTION
EOLNback to summary
public static final String EOLN
FAILURE_MSGback to summary
private static final String FAILURE_MSG
iEndOffsetback to summary
private long iEndOffset
iFragEndback to summary
private long iFragEnd
iFragStartback to summary
private long iFragStart
iHTMLEndback to summary
private long iHTMLEnd
iHTMLStartback to summary
private long iHTMLStart
INVALID_MSGback to summary
private static final String INVALID_MSG
iReadCountback to summary
private long iReadCount
iSelEndback to summary
private long iSelEnd
iSelStartback to summary
private long iSelStart
iStartOffsetback to summary
private long iStartOffset
PADDED_WIDTHback to summary
private static final int PADDED_WIDTH
readModeback to summary
private EHTMLReadMode readMode
SOURCE_URLback to summary
public static final String SOURCE_URL
START_FRAGMENTback to summary
public static final String START_FRAGMENT
START_FRAGMENT_CMTback to summary
public static final String START_FRAGMENT_CMT
START_HTMLback to summary
public static final String START_HTML
START_SELECTIONback to summary
public static final String START_SELECTION
stBaseURLback to summary
private String stBaseURL
stVersionback to summary
private String stVersion
VERSIONback to summary
public static final String VERSION
VERSION_NUMback to summary
private static final String VERSION_NUM

Constructor Detail

HTMLCodecback to summary
public HTMLCodec(InputStream _bytestream, EHTMLReadMode _readMode)

Method Detail

closeback to summary
public synchronized void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.InputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
convertToHTMLFormatback to summary
public static byte[] convertToHTMLFormat(byte[] bytes)

convertToHTMLFormat adds the MS HTML clipboard header to byte array that contains the parameters pairs. The consequence of parameters is fixed, but some or all of them could be omitted. One parameter per one text line. It looks like that: Version:1.0\r\n -- current supported version StartHTML:000000192\r\n -- shift in array to the first byte after the header EndHTML:000000757\r\n -- shift in array of last byte for HTML syntax analysis StartFragment:000000396\r\n -- shift in array jast after EndFragment:000000694\r\n -- shift in array before start StartSelection:000000398\r\n -- shift in array of the first char in copied selection EndSelection:000000692\r\n -- shift in array of the last char in copied selection SourceURL:http://sun.com/\r\n -- base URL for related referenses .............................. ^ ^ ^ ^^ ^ \ StartHTML | \-StartSelection | \EndFragment EndHTML/ \-StartFragment \EndSelection Combinations with tags sequence ...... or ......... are vailid too.

getBaseURLback to summary
public synchronized String getBaseURL() throws IOException
getVersionback to summary
public synchronized String getVersion() throws IOException
parseDescriptionback to summary
private void parseDescription() throws IOException

parseDescription parsing HTML clipboard header as it described in comment to convertToHTMLFormat

readback to summary
public synchronized int read() throws IOException

Implements abstract java.io.InputStream.read.

Doc from java.io.InputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
toPaddedStringback to summary
private static String toPaddedString(int n, int width)