Searched refs:buffer (Results 1 - 25 of 167) sorted by relevance

1234567

/libcore/luni/src/main/java/java/io/
H A DOutputStream.java79 * Equivalent to {@code write(buffer, 0, buffer.length)}.
81 public void write(byte[] buffer) throws IOException { argument
82 write(buffer, 0, buffer.length);
86 * Writes {@code count} bytes from the byte array {@code buffer} starting at
89 * @param buffer
90 * the buffer to be written.
92 * the start position in {@code buffer} from where to get bytes.
94 * the number of bytes from {@code buffer} t
103 write(byte[] buffer, int offset, int count) argument
[all...]
H A DPipedReader.java38 * The circular buffer through which data is passed. Data is read from the
40 * Data in the buffer is either sequential: <pre>
45 * ...or wrapped around the buffer's end: <pre>
50 * When the buffer is empty, {@code in == -1}. Reading when the buffer is
51 * empty will block until data is available. When the buffer is full,
52 * {@code in == out}. Writing when the buffer is full will block until free
55 private char[] buffer; field in class:PipedReader
58 * The index in {@code buffer} where the next character will be written.
63 * The index in {@code buffer} wher
231 read(char[] buffer, int offset, int count) argument
[all...]
H A DInputStream.java160 * Equivalent to {@code read(buffer, 0, buffer.length)}.
162 public int read(byte[] buffer) throws IOException { argument
163 return read(buffer, 0, buffer.length);
170 * @param buffer
173 * the initial position in {@code buffer} to store the bytes read
186 public int read(byte[] buffer, int offset, int length) throws IOException { argument
187 Arrays.checkOffsetAndCount(buffer.length, offset, length);
200 buffer[offse
[all...]
H A DObjectInput.java58 * Reads bytes from this stream into the byte array {@code buffer}. Blocks
61 * @param buffer
68 public int read(byte[] buffer) throws IOException; argument
72 * byte array {@code buffer} starting at offset {@code count}. Blocks while
75 * @param buffer
78 * the initial position in {@code buffer} to store the bytes read
81 * the maximum number of bytes to store in {@code buffer}.
87 public int read(byte[] buffer, int offset, int count) throws IOException; argument
H A DObjectOutput.java46 * Writes the entire contents of the byte array {@code buffer} to the output
49 * @param buffer
50 * the buffer to write.
54 public void write(byte[] buffer) throws IOException; argument
57 * Writes {@code count} bytes from the byte array {@code buffer} starting at
61 * @param buffer
62 * the buffer to write.
64 * the index of the first byte in {@code buffer} to write.
66 * the number of bytes from {@code buffer} to write to the target
71 public void write(byte[] buffer, in argument
[all...]
H A DStringBufferInputStream.java33 protected String buffer; field in class:StringBufferInputStream
59 buffer = str;
78 return pos < count ? buffer.charAt(pos++) & 0xFF : -1;
85 * @param buffer
102 public synchronized int read(byte[] buffer, int offset, int length) { argument
103 if (buffer == null) {
104 throw new NullPointerException("buffer == null");
106 Arrays.checkOffsetAndCount(buffer.length, offset, length);
113 buffer[offset + i] = (byte) this.buffer
[all...]
H A DPipedInputStream.java38 * The circular buffer through which data is passed. Data is read from the
40 * Data in the buffer is either sequential: <pre>
45 * ...or wrapped around the buffer's end: <pre>
50 * When the buffer is empty, {@code in == -1}. Reading when the buffer is
51 * empty will block until data is available. When the buffer is full,
52 * {@code in == out}. Writing when the buffer is full will block until free
55 protected byte[] buffer; field in class:PipedInputStream
58 * The index in {@code buffer} where the next byte will be written.
63 * The index in {@code buffer} wher
[all...]
H A DPushbackInputStream.java26 * during construction. If the buffer of pushed back bytes is empty, bytes are
31 * The buffer that contains pushed-back bytes.
38 * indicates that the buffer is full.
44 * stream as source. The size of the pushback buffer is set to the default
62 * input stream. The size of the pushback buffer is set to {@code size}.
71 * the size of the pushback buffer.
94 * and releases the pushback buffer.
124 * range from 0 to 255. If the pushback buffer does not contain any
151 * the byte array {@code buffer} starting at {@code offset}. Bytes are read
152 * from the pushback buffer firs
176 read(byte[] buffer, int offset, int length) argument
253 unread(byte[] buffer) argument
283 unread(byte[] buffer, int offset, int length) argument
[all...]
/libcore/luni/src/main/java/java/nio/
H A DNioUtils.java30 * Gets the start address of a direct buffer.
39 * the direct buffer whose address shall be returned must not be
41 * @return the address of the buffer given, or zero if the buffer is not a
44 public static int getDirectBufferAddress(Buffer buffer) { argument
45 return buffer.effectiveDirectAddress;
48 public static void freeDirectBuffer(ByteBuffer buffer) { argument
49 if (buffer == null) {
52 if (buffer instanceof DirectByteBuffer) {
53 ((DirectByteBuffer) buffer)
[all...]
/libcore/luni/src/main/java/org/apache/harmony/security/provider/crypto/
H A DSHA1_MessageDigestImpl.java35 private int[] buffer; // buffer has the following structure: field in class:SHA1_MessageDigestImpl
42 private byte[] oneByte; // one byte buffer needed to use in engineUpdate(byte)
43 // having buffer as private field is just optimization
54 buffer = new int[BYTES_OFFSET +6];
86 lastWord = (buffer[BYTES_OFFSET] + 3)>>2 ; // computing of # of full words by shifting
91 // - buffer[BYTES_OFFSET] == 0 - buffer frame is empty,
102 if ( buffer[BYTES_OFFSET] != 0 ) {
108 buffer[1
[all...]
/libcore/luni/src/main/java/libcore/io/
H A DHeapBufferIterator.java28 private final byte[] buffer; field in class:HeapBufferIterator
35 HeapBufferIterator(byte[] buffer, int offset, int byteCount, ByteOrder order) { argument
36 this.buffer = buffer;
51 System.arraycopy(buffer, offset + position, dst, dstOffset, byteCount);
56 byte result = buffer[offset + position];
62 int result = Memory.peekInt(buffer, offset + position, order);
69 Memory.unsafeBulkGet(dst, dstOffset, byteCount, buffer, offset + position, SizeOf.INT, order.needsSwap);
74 short result = Memory.peekShort(buffer, offset + position, order);
80 * Returns a new iterator over {@code buffer}, startin
83 iterator(byte[] buffer, int offset, int byteCount, ByteOrder order) argument
[all...]
H A DPosix.java90 public int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException { argument
91 if (buffer.isDirect()) {
92 return preadBytes(fd, buffer, buffer.position(), buffer.remaining(), offset);
94 return preadBytes(fd, NioUtils.unsafeArray(buffer), NioUtils.unsafeArrayOffset(buffer) + buffer.position(), buffer.remaining(), offset);
101 private native int preadBytes(FileDescriptor fd, Object buffer, in argument
102 pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) argument
113 pwriteBytes(FileDescriptor fd, Object buffer, int bufferOffset, int byteCount, long offset) argument
114 read(FileDescriptor fd, ByteBuffer buffer) argument
125 readBytes(FileDescriptor fd, Object buffer, int offset, int byteCount) argument
127 recvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress) argument
138 recvfromBytes(FileDescriptor fd, Object buffer, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress) argument
142 sendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port) argument
153 sendtoBytes(FileDescriptor fd, Object buffer, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port) argument
178 write(FileDescriptor fd, ByteBuffer buffer) argument
189 writeBytes(FileDescriptor fd, Object buffer, int offset, int byteCount) argument
[all...]
H A DStreams.java40 byte[] buffer = new byte[1];
41 int result = in.read(buffer, 0, 1);
42 return (result != -1) ? buffer[0] & 0xff : -1;
51 byte[] buffer = new byte[1];
52 buffer[0] = (byte) (b & 0xff);
53 out.write(buffer);
106 byte[] buffer = new byte[1024];
108 while ((count = in.read(buffer)) != -1) {
109 bytes.write(buffer, 0, count);
120 char[] buffer
[all...]
/libcore/support/src/test/java/tests/support/
H A DSupport_OutputStream.java17 private byte[] buffer; field in class:Support_OutputStream
35 buffer = new byte[bufferSize];
58 public void write(byte buffer[]) throws IOException { argument
62 for (int i = 0; i < buffer.length; i++) {
63 write(buffer[i]);
68 public void write(byte buffer[], int offset, int count) throws IOException { argument
72 if (offset < 0 || count < 0 || (offset + count) > buffer.length) {
76 write(buffer[i]);
86 buffer[position] = (byte)(oneByte & 255);
89 throw new IOException("Internal buffer overflo
[all...]
/libcore/luni/src/main/java/java/net/
H A DSocks4Message.java55 protected byte[] buffer; field in class:Socks4Message
58 buffer = new byte[BUFFER_LENGTH];
66 return buffer[INDEX_COMMAND];
73 buffer[INDEX_COMMAND] = (byte) command;
80 return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN);
87 Memory.pokeShort(buffer, INDEX_PORT, (short) port, ByteOrder.BIG_ENDIAN);
94 return Memory.peekInt(buffer, INDEX_IP, ByteOrder.BIG_ENDIAN);
101 buffer[INDEX_IP] = ip[0];
102 buffer[INDEX_IP + 1] = ip[1];
103 buffer[INDEX_I
[all...]
/libcore/luni/src/main/java/org/apache/harmony/xml/dom/
H A DCharacterDataImpl.java35 protected StringBuffer buffer; field in class:CharacterDataImpl
43 buffer.append(arg);
47 buffer.delete(offset, offset + count);
51 return buffer.toString();
58 stringBuilder.append(buffer);
62 return buffer.length();
72 buffer.insert(offset, arg);
81 buffer.replace(offset, offset + count, arg);
88 buffer = new StringBuffer(data);
93 return buffer
[all...]
/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
H A DHandshakeIODataStream.java56 * or incompleate filling of destination buffer)
83 // buffer is used to keep the handshaking data;
86 private byte[] buffer = new byte[buff_size]; field in class:HandshakeIODataStream
124 * to delete one message from the internal buffer.
127 System.arraycopy(buffer, read_pos,
128 buffer, marked_pos, read_pos_end - read_pos);
144 return buffer[read_pos++] & 0xFF;
158 System.arraycopy(buffer, read_pos, res, 0, length);
168 System.arraycopy(buffer, read_pos, dst, offset, length);
177 * The attempts to overflow the buffer b
[all...]
H A DSSLEngineAppData.java32 byte[] buffer; field in class:SSLEngineAppData
41 * just the array reference is remembered into the buffer field.
44 if (buffer != null) {
49 buffer = src;
53 * Places the data from the buffer into the array of destination
57 if (buffer == null) {
61 int len = buffer.length;
68 // can fully write remaining data into buffer
69 dsts[i].put(buffer, pos, len - pos);
75 dsts[i].put(buffer, po
[all...]
H A DSSLSocketInputStream.java31 // The size of the internal data buffer.
36 // Internal buffer accumulating the received application data
37 private byte[] buffer = new byte[BUFFER_SIZE]; field in class:SSLSocketInputStream
39 // position of the next byte to read from the buffer
90 buffer = null;
94 * Reads one byte. If there is no data in the underlying buffer,
102 if (buffer == null) {
109 // If there is no data in the buffer
114 return buffer[pos++] & 0xFF;
143 // If the size of the buffer i
[all...]
/libcore/luni/src/main/java/javax/xml/parsers/
H A DFilePathToURI.java64 StringBuilder buffer = new StringBuilder(len*3);
65 buffer.append("file://");
70 buffer.append('/');
82 buffer.append('%');
83 buffer.append(gAfterEscaping1[ch]);
84 buffer.append(gAfterEscaping2[ch]);
88 buffer.append((char)ch);
111 buffer.append('%');
112 buffer.append(gHexChs[ch >> 4]);
113 buffer
[all...]
/libcore/luni/src/main/java/javax/xml/transform/stream/
H A DFilePathToURI.java64 StringBuilder buffer = new StringBuilder(len*3);
65 buffer.append("file://");
70 buffer.append('/');
82 buffer.append('%');
83 buffer.append(gAfterEscaping1[ch]);
84 buffer.append(gAfterEscaping2[ch]);
88 buffer.append((char)ch);
111 buffer.append('%');
112 buffer.append(gHexChs[ch >> 4]);
113 buffer
[all...]
/libcore/luni/src/test/java/libcore/java/io/
H A DOldOutputStreamTest.java28 private byte[] buffer; field in class:OldOutputStreamTest.BasicOutputStream
32 buffer = new byte[BUFFER_SIZE];
38 buffer[position] = (byte) (oneByte & 255);
41 throw new IOException("Internal buffer overflow.");
46 return buffer;
56 byte[] buffer;
65 buffer = bos.getBuffer();
67 expected = (shortByteArray[i] == buffer[i]);
81 byte[] buffer;
90 buffer
[all...]
/libcore/luni/src/main/java/java/nio/channels/
H A DReadableByteChannel.java34 * Reads bytes from the channel into the given buffer.
38 * buffer when the method is invoked. The bytes will be read into the buffer
39 * starting at the buffer's current
45 * Upon completion, the buffer's {@code position} is updated to the end of
46 * the bytes that were read. The buffer's
49 * @param buffer
50 * the byte buffer to receive the bytes.
65 public int read(ByteBuffer buffer) throws IOException; argument
H A DWritableByteChannel.java34 * Writes bytes from the given buffer to the channel.
37 * <code>remaining()</code> number of bytes in the buffer when the method
38 * invoked. The bytes will be written from the buffer starting at the
39 * buffer's <code>position</code>.
44 * Upon completion, the buffer's <code>position()</code> is updated to the
45 * end of the bytes that were written. The buffer's <code>limit()</code>
48 * @param buffer
49 * the byte buffer containing the bytes to be written.
63 public int write(ByteBuffer buffer) throws IOException; argument
/libcore/luni/src/main/java/libcore/net/http/
H A DUnknownLengthHttpInputStream.java35 @Override public int read(byte[] buffer, int offset, int count) throws IOException { argument
36 Arrays.checkOffsetAndCount(buffer.length, offset, count);
41 int read = in.read(buffer, offset, count);
47 cacheWrite(buffer, offset, read);

Completed in 730 milliseconds

1234567