/** * Adds the specified {@link ByteArray} to the first * position in the list * * @param ba The ByteArray to add to the list */ public void addFirst(ByteArray ba) { addHook(ba); bas.addFirst(ba); }
/** * Adds the specified {@link ByteArray} to the end of the list * * @param ba The ByteArray to add to the end of the list */ public void addLast(ByteArray ba) { addHook(ba); bas.addLast(ba); }
/** * @inheritDoc */ public int first() { return bas.firstByte(); }
/** * {@inheritDoc} */ @Override public void free() { while (!bas.isEmpty()) { Node node = bas.getLast(); node.getByteArray().free(); bas.removeLast(); } }
if (bas.isEmpty()) { ByteArray ba = byteArrayFactory.create(1); return ba.getSingleIoBuffer(); Node firstNode = bas.getFirst(); ByteArray ba = firstNode.getByteArray(); while (!bas.isEmpty()) { Node node = bas.getLast(); ByteArray component = node.getByteArray(); bas.removeLast(); component.free(); bas.addLast(target);
/** * Adds the specified {@link ByteArray} to * the beginning of the list * * @param ba * The ByteArray to be added to the list */ public void addFirst(ByteArray ba) { addNode(new Node(ba), header.next); firstByte -= ba.last(); }
/** * Removes the last {@link ByteArray} in the list * * @return The ByteArray that was removed */ public ByteArray removeLast() { Node node = bas.removeLast(); return node == null ? null : node.getByteArray(); }
/** * Remove the first {@link ByteArray} in the list * * @return The first ByteArray in the list */ public ByteArray removeFirst() { Node node = bas.removeFirst(); return node == null ? null : node.getByteArray(); }
/** * {@inheritDoc} */ @Override public int last() { return bas.lastByte(); }
if (bas.isEmpty()) { ByteArray ba = byteArrayFactory.create(1); return ba.getSingleIoBuffer(); Node firstNode = bas.getFirst(); ByteArray ba = firstNode.getByteArray(); while (!bas.isEmpty()) { Node node = bas.getLast(); ByteArray component = node.getByteArray(); bas.removeLast(); component.free(); bas.addLast(target);
/** * @inheritDoc */ public void free() { while ( !bas.isEmpty() ) { Node node = bas.getLast(); node.getByteArray().free(); bas.removeLast(); } }
/** * Add the specified {@link ByteArray} to * the end of the list * * @param ba * The ByteArray to be added to the list */ public void addLast(ByteArray ba) { addNode(new Node(ba), header); lastByte += ba.last(); }
/** * Removes the last {@link ByteArray} in the list * * @return * The ByteArray that was removed */ public ByteArray removeLast() { Node node = bas.removeLast(); return node == null ? null : node.getByteArray(); }
/** * Remove the first {@link ByteArray} in the list * * @return * The first ByteArray in the list */ public ByteArray removeFirst() { Node node = bas.removeFirst(); return node == null ? null : node.getByteArray(); }
/** * {@inheritDoc} */ @Override public int last() { return bas.lastByte(); }
if ( bas.isEmpty() ) { ByteArray ba = byteArrayFactory.create( 1 ); return ba.getSingleIoBuffer(); Node node = bas.getFirst(); ByteArray ba = node.getByteArray(); while ( !bas.isEmpty() ) { Node node = bas.getLast(); ByteArray component = node.getByteArray(); bas.removeLast(); component.free(); bas.addLast( target ); return bb;