/** * For every String write to bytebuffer * * @return bytebuffer that should be written to file to persist this datatype. */ public byte[] writeByteArray() { logger.finer("Writing MultipleTextEncodedStringNullTerminated"); int localSize = 0; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); try { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext();) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); buffer.write(next.writeByteArray()); localSize += next.getSize(); } } catch (IOException ioe) { //This should never happen because the write is internal with the JVM it is not to a file logger.log(Level.SEVERE, "IOException in MultipleTextEncodedStringNullTerminated when writing byte array", ioe); throw new RuntimeException(ioe); } //Update size member variable size = localSize; logger.finer("Written MultipleTextEncodedStringNullTerminated"); return buffer.toByteArray(); }
((Values) value).add((String) next.getValue());
((Values) value).add((String) next.getValue());
} else { ((Values) value).add((String) next.getValue());
/** * For every String write to bytebuffer * * @return bytebuffer that should be written to file to persist this datatype. */ public byte[] writeByteArray() { logger.finer("Writing MultipleTextEncodedStringNullTerminated"); int localSize = 0; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); try { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext();) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); buffer.write(next.writeByteArray()); localSize += next.getSize(); } } catch (IOException ioe) { //This should never happen because the write is internal with the JVM it is not to a file logger.log(Level.SEVERE, "IOException in MultipleTextEncodedStringNullTerminated when writing byte array", ioe); throw new RuntimeException(ioe); } //Update size member variable size = localSize; logger.finer("Written MultipleTextEncodedStringNullTerminated"); return buffer.toByteArray(); }
/** * For every String write to bytebuffer * * @return bytebuffer that should be written to file to persist this datatype. */ public byte[] writeByteArray() { // logger.finer("Writing MultipleTextEncodedStringNullTerminated"); int localSize = 0; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); try { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext(); ) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); buffer.write(next.writeByteArray()); localSize += next.getSize(); } } catch (IOException ioe) { //This should never happen because the write is internal with the JVM it is not to a file logger.log(Level.SEVERE, "IOException in MultipleTextEncodedStringNullTerminated when writing byte array", ioe); throw new RuntimeException(ioe); } //Update size member variable size = localSize; // //logger.finer("Written MultipleTextEncodedStringNullTerminated"); return buffer.toByteArray(); }
/** * Check the value can be encoded with the specified encoding * @return */ public boolean canBeEncoded() { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext();) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); if (!next.canBeEncoded()) { return false; } } return true; }
/** * Check the value can be encoded with the specified encoding * @return */ public boolean canBeEncoded() { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext();) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); if (!next.canBeEncoded()) { return false; } } return true; }
/** * Check the value can be encoded with the specified encoding * * @return */ public boolean canBeEncoded() { for (ListIterator<String> li = ((Values) value).getList().listIterator(); li.hasNext(); ) { TextEncodedStringNullTerminated next = new TextEncodedStringNullTerminated(identifier, frameBody, li.next()); if (!next.canBeEncoded()) { return false; } } return true; }
public MultipleTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object) { super(object); value = new MultipleTextEncodedStringNullTerminated.Values(); }
/** * Creates a new ObjectStringSizeTerminated datatype. * * @param identifier identifies the frame type * @param frameBody */ public MultipleTextEncodedStringNullTerminated(String identifier, AbstractTagFrameBody frameBody) { super(identifier, frameBody); value = new MultipleTextEncodedStringNullTerminated.Values(); }
public MultipleTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object) { super(object); value = new MultipleTextEncodedStringNullTerminated.Values(); }
public MultipleTextEncodedStringNullTerminated(TextEncodedStringSizeTerminated object) { super(object); value = new MultipleTextEncodedStringNullTerminated.Values(); }
/** * Creates a new ObjectStringSizeTerminated datatype. * * @param identifier identifies the frame type * @param frameBody */ public MultipleTextEncodedStringNullTerminated(String identifier, AbstractTagFrameBody frameBody) { super(identifier, frameBody); value = new MultipleTextEncodedStringNullTerminated.Values(); }
/** * Creates a new ObjectStringSizeTerminated datatype. * * @param identifier identifies the frame type * @param frameBody */ public MultipleTextEncodedStringNullTerminated(String identifier, AbstractTagFrameBody frameBody) { super(identifier, frameBody); value = new MultipleTextEncodedStringNullTerminated.Values(); }