1 package org.apache.lucene.store;
3 import org.apache.lucene.util.BytesRef;
8 public class ByteArrayDataOutput extends DataOutput {
14 public ByteArrayDataOutput(byte[] bytes) {
18 public ByteArrayDataOutput(byte[] bytes, int offset, int len) {
19 reset(bytes, offset, len);
22 public ByteArrayDataOutput() {
23 reset(BytesRef.EMPTY_BYTES);
26 public void reset(byte[] bytes) {
27 reset(bytes, 0, bytes.length);
30 public void reset(byte[] bytes, int offset, int len) {
36 public int getPosition() {
41 public void writeByte(byte b) {
47 public void writeBytes(byte[] b, int offset, int length) {
48 assert pos + length <= limit;
49 System.arraycopy(b, offset, bytes, pos, length);