1 52 53 package com.go.trove.io; 54 55 import java.io.OutputStream ; 56 import java.io.IOException ; 57 import java.io.Serializable ; 58 59 66 public class ArrayByteData implements ByteData, Serializable { 67 private byte[] mData; 68 private int mOffset; 69 private int mLength; 70 71 public ArrayByteData(byte[] data) { 72 this(data, 0, data.length); 73 } 74 75 public ArrayByteData(byte[] data, int offset, int length) { 76 mData = data; 77 mOffset = offset; 78 mLength = length; 79 } 80 81 public long getByteCount() { 82 return mLength; 83 } 84 85 public void writeTo(OutputStream out) throws IOException { 86 out.write(mData, mOffset, mLength); 87 } 88 89 public void reset() { 90 } 92 } 93 | Popular Tags |