public static byte[] ToByteArray(ByteBuffer buffer, int length) { if (buffer.HasBuffer && buffer.Offset == 0) { // The backing array should work out fine for us return buffer.Buffer; } byte[] data = new byte[length]; buffer.Read(data); return data; }
public abstract void Write(ByteBuffer src, long position);
//public static void WriteBlock(BATBlock bat, byte[] block) public static void WriteBlock(BATBlock bat, ByteBuffer block) { bat.WriteData(block); }