Home | History | Annotate | Download | only in hardware

Lines Matching refs:buffer

80      * Reads data into the provided buffer.
81 * Note that the value returned by {@link java.nio.Buffer#position()} on this buffer is
84 * @param buffer to read into
87 public int read(ByteBuffer buffer) throws IOException {
88 if (buffer.isDirect()) {
89 return native_read_direct(buffer, buffer.remaining());
90 } else if (buffer.hasArray()) {
91 return native_read_array(buffer.array(), buffer.remaining());
93 throw new IllegalArgumentException("buffer is not direct and has no array");
98 * Writes data from provided buffer.
99 * Note that the value returned by {@link java.nio.Buffer#position()} on this buffer is
102 * @param buffer to write
105 public void write(ByteBuffer buffer, int length) throws IOException {
106 if (buffer.isDirect()) {
107 native_write_direct(buffer, length);
108 } else if (buffer.hasArray()) {
109 native_write_array(buffer.array(), length);
111 throw new IllegalArgumentException("buffer is not direct and has no array");
124 private native int native_read_array(byte[] buffer, int length) throws IOException;
125 private native int native_read_direct(ByteBuffer buffer, int length) throws IOException;
126 private native void native_write_array(byte[] buffer, int length) throws IOException;
127 private native void native_write_direct(ByteBuffer buffer, int length) throws IOException;