/libcore/luni/src/main/java/java/io/ |
H A D | OutputStream.java | 79 * 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 D | PipedReader.java | 39 * The circular buffer through which data is passed. Data is read from the 41 * Data in the buffer is either sequential: <pre> 46 * ...or wrapped around the buffer's end: <pre> 51 * When the buffer is empty, {@code in == -1}. Reading when the buffer is 52 * empty will block until data is available. When the buffer is full, 53 * {@code in == out}. Writing when the buffer is full will block until free 56 private char[] buffer; field in class:PipedReader 59 * The index in {@code buffer} where the next character will be written. 64 * The index in {@code buffer} wher 224 read(char[] buffer, int offset, int count) argument [all...] |
H A D | InputStream.java | 159 * Equivalent to {@code read(buffer, 0, buffer.length)}. 161 public int read(byte[] buffer) throws IOException { argument 162 return read(buffer, 0, buffer.length); 167 * the byte array {@code buffer} starting at {@code byteOffset}. 172 * if {@code byteOffset < 0 || byteCount < 0 || byteOffset + byteCount > buffer.length}. 176 public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException { argument 177 Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); 190 buffer[byteOffse [all...] |
H A D | ObjectInput.java | 58 * Reads bytes from this stream into the byte array {@code buffer}. Blocks 65 public int read(byte[] buffer) throws IOException; argument 69 * byte array {@code buffer} starting at offset {@code byteOffset}. Blocks while 76 public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException; argument
|
H A D | ObjectOutput.java | 46 * 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 D | StringBufferInputStream.java | 33 protected String buffer; field in class:StringBufferInputStream 59 buffer = str; 78 return pos < count ? buffer.charAt(pos++) & 0xFF : -1; 81 @Override public synchronized int read(byte[] buffer, int byteOffset, int byteCount) { argument 82 if (buffer == null) { 83 throw new NullPointerException("buffer == null"); 85 Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); 92 buffer[byteOffset + i] = (byte) this.buffer.charAt(pos + i);
|
H A D | PipedInputStream.java | 39 * The circular buffer through which data is passed. Data is read from the 41 * Data in the buffer is either sequential: <pre> 46 * ...or wrapped around the buffer's end: <pre> 51 * When the buffer is empty, {@code in == -1}. Reading when the buffer is 52 * empty will block until data is available. When the buffer is full, 53 * {@code in == out}. Writing when the buffer is full will block until free 56 protected byte[] buffer; field in class:PipedInputStream 59 * The index in {@code buffer} where the next byte will be written. 64 * The index in {@code buffer} wher [all...] |
H A D | PushbackInputStream.java | 26 * 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 byteOffset}. Bytes are read 152 * from the pushback buffer firs 166 read(byte[] buffer, int byteOffset, int byteCount) argument 242 unread(byte[] buffer) argument 272 unread(byte[] buffer, int offset, int length) argument [all...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
H A D | ASCCharsetDecoderTest.java | 48 // ByteBuffer buffer = ByteBuffer.allocate(8); 49 // buffer.put((byte)-1); 50 // buffer.put(unibytes); 51 // buffer.flip(); 52 // return buffer; 58 ByteBuffer buffer = ByteBuffer.allocate(8); 59 buffer.put((byte) -1); 60 buffer.put(getByteBuffer()); 61 buffer.flip(); 62 return buffer; [all...] |
H A D | GBCharsetDecoderTest.java | 53 ByteBuffer buffer = ByteBuffer.allocate(20); 54 buffer.put(new byte[] { (byte) 0xd8 }); 55 buffer.put(getByteBuffer()); 56 buffer.flip(); 57 return buffer;
|
H A D | UTFCharsetDecoderTest.java | 53 ByteBuffer buffer = ByteBuffer.allocate(getByteBuffer().remaining() + 1); 54 buffer.put((byte) 0xd8); 55 buffer.put(getByteBuffer()); 56 buffer.flip(); 57 return buffer; 65 return " buffer \u041c\u0430\u0441\u044e\u043b\u044f \u611b";
|
/libcore/luni/src/main/java/libcore/io/ |
H A D | HeapBufferIterator.java | 28 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 D | Streams.java | 40 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...] |
H A D | Posix.java | 118 public int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, InterruptedIOException { argument 120 final int position = buffer.position(); 122 if (buffer.isDirect()) { 123 bytesRead = preadBytes(fd, buffer, position, buffer.remaining(), offset); 125 bytesRead = preadBytes(fd, NioUtils.unsafeArray(buffer), NioUtils.unsafeArrayOffset(buffer) + position, buffer.remaining(), offset); 128 maybeUpdateBufferPosition(buffer, position, bytesRead); 135 private native int preadBytes(FileDescriptor fd, Object buffer, in argument 136 pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) argument 153 pwriteBytes(FileDescriptor fd, Object buffer, int bufferOffset, int byteCount, long offset) argument 154 read(FileDescriptor fd, ByteBuffer buffer) argument 171 readBytes(FileDescriptor fd, Object buffer, int offset, int byteCount) argument 174 recvfrom(FileDescriptor fd, ByteBuffer buffer, int flags, InetSocketAddress srcAddress) argument 191 recvfromBytes(FileDescriptor fd, Object buffer, int byteOffset, int byteCount, int flags, InetSocketAddress srcAddress) argument 196 sendto(FileDescriptor fd, ByteBuffer buffer, int flags, InetAddress inetAddress, int port) argument 216 sendtoBytes(FileDescriptor fd, Object buffer, int byteOffset, int byteCount, int flags, InetAddress inetAddress, int port) argument 217 sendtoBytes(FileDescriptor fd, Object buffer, int byteOffset, int byteCount, int flags, SocketAddress address) argument 257 write(FileDescriptor fd, ByteBuffer buffer) argument 273 writeBytes(FileDescriptor fd, Object buffer, int offset, int byteCount) argument 276 maybeUpdateBufferPosition(ByteBuffer buffer, int originalPosition, int bytesReadOrWritten) argument [all...] |
/libcore/support/src/test/java/tests/support/ |
H A D | Support_OutputStream.java | 17 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...] |
H A D | Streams.java | 37 byte[] buffer = new byte[1024]; 40 while ((count = source.read(buffer)) != -1) { 41 out.write(buffer, 0, count); 50 char[] buffer = new char[1024]; 53 while ((count = fileReader.read(buffer)) != -1) { 54 out.write(buffer, 0, count);
|
/libcore/luni/src/main/java/java/net/ |
H A D | Socks4Message.java | 55 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 D | CharacterDataImpl.java | 35 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/javax/xml/parsers/ |
H A D | FilePathToURI.java | 64 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 D | FilePathToURI.java | 64 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/dex/src/main/java/com/android/dex/ |
H A D | ClassDef.java | 24 private final Dex buffer; field in class:ClassDef 35 public ClassDef(Dex buffer, int offset, int typeIndex, int accessFlags, argument 38 this.buffer = buffer; 67 return buffer.readTypeList(interfacesOffset).getTypes(); 91 if (buffer == null) { 96 result.append(buffer.typeNames().get(typeIndex)); 98 result.append(" extends ").append(buffer.typeNames().get(supertypeIndex));
|
/libcore/luni/src/test/java/libcore/java/io/ |
H A D | OldOutputStreamTest.java | 28 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
H A D | StringBufferTest.java | 33 StringBuffer buffer = new StringBuffer("abcde"); 35 buffer.setLength(-1); 41 assertEquals("abcde", buffer.toString()); 42 buffer.setLength(1); 43 buffer.append('f'); 44 assertEquals("af", buffer.toString()); 46 buffer = new StringBuffer("abcde"); 47 assertEquals("cde", buffer.substring(2)); 48 buffer.setLength(3); 49 buffer [all...] |
/libcore/luni/src/main/java/java/nio/channels/ |
H A D | ReadableByteChannel.java | 34 * 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 D | WritableByteChannel.java | 34 * 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
|