-
Enhancement
-
Resolution: Won't Do
-
Optional
-
5.0.4
-
None
-
False
-
False
-
Undefined
-
"DataInput's void readFully(byte b[])" will cause an extra copy when reading bytes from DataInput. Sometimes business logic needs to read bytes from DataInput first, then process them conditionally(or will not process at all) , is it possible to support ByteBuffer api like:
public interface XDataInput extends DataInput
{ ByteBuffer readBuffer(int n); }public interface XDataOutput extends DataOutput
{ void writeBuffer(ByteBuffer value); }ByteArrayDataInputStream.java
@Override
public ByteBuffer readBuffer(int n)
public interface Streamable
{ void writeTo(XDataOutput out) throws IOException; void readFrom(XDataInput in) throws IOException, ClassNotFoundException; }