< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java

Print this page

        

*** 37,57 **** /** * A Comment marker segment. Retains an array of bytes representing the * comment data as it is read from the stream. If the marker segment is * constructed from a String, then local default encoding is assumed * when creating the byte array. If the marker segment is created from ! * an <code>IIOMetadataNode</code>, the user object, if present is * assumed to be a byte array containing the comment data. If there is * no user object then the comment attribute is used to create the * byte array, again assuming the default local encoding. */ class COMMarkerSegment extends MarkerSegment { private static final String ENCODING = "ISO-8859-1"; /** * Constructs a marker segment from the given buffer, which contains ! * data from an <code>ImageInputStream</code>. This is used when * reading metadata from a stream. */ COMMarkerSegment(JPEGBuffer buffer) throws IOException { super(buffer); loadData(buffer); --- 37,57 ---- /** * A Comment marker segment. Retains an array of bytes representing the * comment data as it is read from the stream. If the marker segment is * constructed from a String, then local default encoding is assumed * when creating the byte array. If the marker segment is created from ! * an {@code IIOMetadataNode}, the user object, if present is * assumed to be a byte array containing the comment data. If there is * no user object then the comment attribute is used to create the * byte array, again assuming the default local encoding. */ class COMMarkerSegment extends MarkerSegment { private static final String ENCODING = "ISO-8859-1"; /** * Constructs a marker segment from the given buffer, which contains ! * data from an {@code ImageInputStream}. This is used when * reading metadata from a stream. */ COMMarkerSegment(JPEGBuffer buffer) throws IOException { super(buffer); loadData(buffer);
*** 67,77 **** data = comment.getBytes(); // Default encoding } /** * Constructs a marker segment from a native tree node. If the node ! * is an <code>IIOMetadataNode</code> and contains a user object, * that object is used rather than the string attribute. If the * string attribute is used, the default encoding is used. */ COMMarkerSegment(Node node) throws IIOInvalidTreeException{ super(JPEG.COM); --- 67,77 ---- data = comment.getBytes(); // Default encoding } /** * Constructs a marker segment from a native tree node. If the node ! * is an {@code IIOMetadataNode} and contains a user object, * that object is used rather than the string attribute. If the * string attribute is used, the default encoding is used. */ COMMarkerSegment(Node node) throws IIOInvalidTreeException{ super(JPEG.COM);
*** 101,111 **** } catch (UnsupportedEncodingException e) {} // Won't happen return null; } /** ! * Returns an <code>IIOMetadataNode</code> containing the data array * as a user object and a string encoded using ISO-8895-1, as an * attribute. */ IIOMetadataNode getNativeNode() { IIOMetadataNode node = new IIOMetadataNode("com"); --- 101,111 ---- } catch (UnsupportedEncodingException e) {} // Won't happen return null; } /** ! * Returns an {@code IIOMetadataNode} containing the data array * as a user object and a string encoded using ISO-8895-1, as an * attribute. */ IIOMetadataNode getNativeNode() { IIOMetadataNode node = new IIOMetadataNode("com");
< prev index next >