1 32 33 package com.imagero.uio.buffer; 34 35 import java.io.IOException ; 36 37 40 public class ByteBuffer implements Buffer { 41 boolean dirty; 42 43 private final byte[] data; 44 45 public ByteBuffer(byte[] data) { 46 this.data = data; 47 } 48 49 public byte[] getData() throws IOException { 50 return data; 51 } 52 53 public byte[] getData(byte[] d) throws IOException { 54 System.arraycopy(data, 0, d, 0, Math.min(d.length, data.length)); 55 return d; 56 } 57 58 public int length() { 59 return data.length; 60 } 61 62 public boolean isDirty() { 63 return dirty; 64 } 65 } 66 | Popular Tags |