/** * Compares the message Buffer to the specified byte array. * @param b the <code>byte[]</code> to compare * * @return true if the comparison succeeded, false otherwise * * @since 2.3 */ public boolean equals(final byte[] b) { return equals(b, 0, b.length); }
public boolean equalsIgnoreCase(final byte[] b) { return equalsIgnoreCase(b, 0, b.length); }
/** * Compares the buffer chunk to the specified byte array representing * lower-case ASCII characters. * * @param b the <code>byte[]</code> to compare * * @return true if the comparison succeeded, false otherwise * * @since 2.1.2 */ public boolean equalsIgnoreCaseLowerCase(final byte[] b) { return equalsIgnoreCaseLowerCase(buffer, start, end, b); }
public static SettingsFrame fromBase64Uri(final DataChunk src) { if (src.getType() == DataChunk.Type.Bytes) { final ByteChunk bc = src.getByteChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } else if (src.getType() == DataChunk.Type.Buffer) { final BufferChunk bc = src.getBufferChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } return parseBase64Uri(src.toString()); }
public void append(final BufferChunk bc) { final int oldPos = buffer.position(); final int oldLim = buffer.limit(); final int srcLen = bc.getLength() ; Buffers.setPositionLimit(buffer, end, end + srcLen); buffer.put(bc.getBuffer(), bc.getStart(), srcLen); Buffers.setPositionLimit(buffer, oldPos, oldLim); end += srcLen; }
protected DataChunk() { this(new ByteChunk(), new BufferChunk(), new CharChunk(), null); }
@Override public final void delete(final int from, final int to) { switch (type) { case Bytes: byteChunk.delete(from, to); return; case Buffer: bufferChunk.delete(from, to); return; case String: stringValue = stringValue.substring(0, from) + stringValue.substring(to, stringValue.length()); return; case Chars: charChunk.delete(from, to); } }
/** * Returns the <tt>DataChunk</tt> end position. * * @return the <tt>DataChunk</tt> end position. */ @Override public int getEnd() { switch (type) { case Bytes: return byteChunk.getEnd(); case Buffer: return bufferChunk.getEnd(); case Chars: return charChunk.getEnd(); default: return stringValue.length(); } }
public static SettingsFrame fromBase64Uri(final DataChunk src) { if (src.getType() == DataChunk.Type.Bytes) { final ByteChunk bc = src.getByteChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } else if (src.getType() == DataChunk.Type.Buffer) { final BufferChunk bc = src.getBufferChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } return parseBase64Uri(src.toString()); }
public void append(final BufferChunk bc) { final int oldPos = buffer.position(); final int oldLim = buffer.limit(); final int srcLen = bc.getLength() ; Buffers.setPositionLimit(buffer, end, end + srcLen); buffer.put(bc.getBuffer(), bc.getStart(), srcLen); Buffers.setPositionLimit(buffer, oldPos, oldLim); end += srcLen; }
protected DataChunk() { this(new ByteChunk(), new BufferChunk(), new CharChunk(), null); }
@Override public final void delete(final int from, final int to) { switch (type) { case Bytes: byteChunk.delete(from, to); return; case Buffer: bufferChunk.delete(from, to); return; case String: stringValue = stringValue.substring(0, from) + stringValue.substring(to, stringValue.length()); return; case Chars: charChunk.delete(from, to); } }
/** * Returns the <tt>DataChunk</tt> end position. * * @return the <tt>DataChunk</tt> end position. */ @Override public int getEnd() { switch (type) { case Bytes: return byteChunk.getEnd(); case Buffer: return bufferChunk.getEnd(); case Chars: return charChunk.getEnd(); default: return stringValue.length(); } }
public static SettingsFrame fromBase64Uri(final DataChunk src) { if (src.getType() == DataChunk.Type.Bytes) { final ByteChunk bc = src.getByteChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } else if (src.getType() == DataChunk.Type.Buffer) { final BufferChunk bc = src.getBufferChunk(); return parseBase64Uri(bc.getBuffer(), bc.getStart(), bc.getEnd()); } return parseBase64Uri(src.toString()); }
public void append(final BufferChunk bc) { final int oldPos = buffer.position(); final int oldLim = buffer.limit(); final int srcLen = bc.getLength() ; Buffers.setPositionLimit(buffer, end, end + srcLen); buffer.put(bc.getBuffer(), bc.getStart(), srcLen); Buffers.setPositionLimit(buffer, oldPos, oldLim); end += srcLen; }
/** * Compares the message Buffer to the specified byte array. * @param b the <code>byte[]</code> to compare * * @return true if the comparison succeeded, false otherwise * * @since 2.3 */ public boolean equals(final byte[] b) { return equals(b, 0, b.length); }
protected DataChunk() { this(new ByteChunk(), new BufferChunk(), new CharChunk(), null); }