Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 193) sorted by relevance

12345678

/libcore/luni/src/main/java/java/io/
DPipedReader.java56 private char[] buffer; field in PipedReader
112 buffer = new char[pipeSize]; in PipedReader()
140 buffer = null; in close()
172 if (buffer == null) { // We may already have allocated the buffer. in establishConnection()
173 buffer = new char[PIPE_SIZE]; in establishConnection()
224 … @Override public synchronized int read(char[] buffer, int offset, int count) throws IOException { in read() argument
228 if (this.buffer == null) { in read()
231 Arrays.checkOffsetAndCount(buffer.length, offset, count); in read()
263 copyLength = count > this.buffer.length - out ? this.buffer.length - out : count; in read()
264 System.arraycopy(this.buffer, out, buffer, offset, copyLength); in read()
[all …]
DPipedInputStream.java56 protected byte[] buffer; field in PipedInputStream
112 buffer = new byte[pipeSize]; in PipedInputStream()
142 if (buffer == null || in == -1) { in available()
145 return in <= out ? buffer.length - out + in : in - out; in available()
157 buffer = null; in close()
185 if (buffer == null) { // We may already have allocated the buffer. in establishConnection()
186 buffer = new byte[PipedInputStream.PIPE_SIZE]; in establishConnection()
214 if (buffer == null) { in read()
242 int result = buffer[out++] & 0xff; in read()
243 if (out == buffer.length) { in read()
[all …]
DStringBufferInputStream.java33 protected String buffer; field in StringBufferInputStream
59 buffer = str; in StringBufferInputStream()
78 return pos < count ? buffer.charAt(pos++) & 0xFF : -1; in read()
81 @Override public synchronized int read(byte[] buffer, int byteOffset, int byteCount) { in read() argument
82 if (buffer == null) { in read()
85 Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); in read()
92 buffer[byteOffset + i] = (byte) this.buffer.charAt(pos + i); in read()
DOutputStream.java81 public void write(byte[] buffer) throws IOException { in write() argument
82 write(buffer, 0, buffer.length); in write()
103 public void write(byte[] buffer, int offset, int count) throws IOException { in write() argument
104 Arrays.checkOffsetAndCount(buffer.length, offset, count); in write()
106 write(buffer[i]); in write()
DInputStream.java161 public int read(byte[] buffer) throws IOException { in read() argument
162 return read(buffer, 0, buffer.length); in read()
176 public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException { in read() argument
177 Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); in read()
190 buffer[byteOffset + i] = (byte) c; in read()
DPushbackReader.java172 public int read(char[] buffer, int offset, int count) throws IOException { in read() argument
175 Arrays.checkOffsetAndCount(buffer.length, offset, count); in read()
184 System.arraycopy(buf, pos, buffer, newOffset, copyLength); in read()
194 int inCopied = in.read(buffer, newOffset, count - copiedChars); in read()
259 public void unread(char[] buffer) throws IOException { in unread() argument
260 unread(buffer, 0, buffer.length); in unread()
293 public void unread(char[] buffer, int offset, int length) throws IOException { in unread() argument
299 Arrays.checkOffsetAndCount(buffer.length, offset, length); in unread()
301 unread(buffer[i]); in unread()
/libcore/luni/src/main/java/java/net/
DSocks4Message.java55 protected byte[] buffer; field in Socks4Message
58 buffer = new byte[BUFFER_LENGTH]; in Socks4Message()
66 return buffer[INDEX_COMMAND]; in getCommandOrResult()
73 buffer[INDEX_COMMAND] = (byte) command; in setCommandOrResult()
80 return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN); in getPort()
87 Memory.pokeShort(buffer, INDEX_PORT, (short) port, ByteOrder.BIG_ENDIAN); in setPort()
94 return Memory.peekInt(buffer, INDEX_IP, ByteOrder.BIG_ENDIAN); in getIP()
101 buffer[INDEX_IP] = ip[0]; in setIP()
102 buffer[INDEX_IP + 1] = ip[1]; in setIP()
103 buffer[INDEX_IP + 2] = ip[2]; in setIP()
[all …]
/libcore/luni/src/main/java/libcore/io/
DStreams.java40 byte[] buffer = new byte[1]; in readSingleByte()
41 int result = in.read(buffer, 0, 1); in readSingleByte()
42 return (result != -1) ? buffer[0] & 0xff : -1; in readSingleByte()
51 byte[] buffer = new byte[1]; in writeSingleByte()
52 buffer[0] = (byte) (b & 0xff); in writeSingleByte()
53 out.write(buffer); in writeSingleByte()
106 byte[] buffer = new byte[1024]; in readFullyNoClose()
108 while ((count = in.read(buffer)) != -1) { in readFullyNoClose()
109 bytes.write(buffer, 0, count); in readFullyNoClose()
120 char[] buffer = new char[1024]; in readFully() local
[all …]
DPosix.java114 …public int pread(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, Interru… in pread() argument
116 final int position = buffer.position(); in pread()
118 if (buffer.isDirect()) { in pread()
119 bytesRead = preadBytes(fd, buffer, position, buffer.remaining(), offset); in pread()
121 …esRead = preadBytes(fd, NioUtils.unsafeArray(buffer), NioUtils.unsafeArrayOffset(buffer) + positio… in pread()
124 maybeUpdateBufferPosition(buffer, position, bytesRead); in pread()
131 …private native int preadBytes(FileDescriptor fd, Object buffer, int bufferOffset, int byteCount, l… in preadBytes() argument
132 …public int pwrite(FileDescriptor fd, ByteBuffer buffer, long offset) throws ErrnoException, Interr… in pwrite() argument
134 final int position = buffer.position(); in pwrite()
136 if (buffer.isDirect()) { in pwrite()
[all …]
DHeapBufferIterator.java28 private final byte[] buffer; field in HeapBufferIterator
35 HeapBufferIterator(byte[] buffer, int offset, int byteCount, ByteOrder order) { in HeapBufferIterator() argument
36 this.buffer = buffer; in HeapBufferIterator()
51 System.arraycopy(buffer, offset + position, dst, dstOffset, byteCount); in readByteArray()
56 byte result = buffer[offset + position]; in readByte()
62 int result = Memory.peekInt(buffer, offset + position, order); in readInt()
69 …Memory.unsafeBulkGet(dst, dstOffset, byteCount, buffer, offset + position, SizeOf.INT, order.needs… in readIntArray()
74 short result = Memory.peekShort(buffer, offset + position, order); in readShort()
83 … public static BufferIterator iterator(byte[] buffer, int offset, int byteCount, ByteOrder order) { in iterator() argument
84 return new HeapBufferIterator(buffer, offset, byteCount, order); in iterator()
/libcore/luni/src/main/java/javax/xml/parsers/
DFilePathToURI.java64 StringBuilder buffer = new StringBuilder(len*3); in filepath2URI() local
65 buffer.append("file://"); in filepath2URI()
70 buffer.append('/'); in filepath2URI()
82 buffer.append('%'); in filepath2URI()
83 buffer.append(gAfterEscaping1[ch]); in filepath2URI()
84 buffer.append(gAfterEscaping2[ch]); in filepath2URI()
88 buffer.append((char)ch); in filepath2URI()
111 buffer.append('%'); in filepath2URI()
112 buffer.append(gHexChs[ch >> 4]); in filepath2URI()
113 buffer.append(gHexChs[ch & 0xf]); in filepath2URI()
[all …]
/libcore/luni/src/main/java/javax/xml/transform/stream/
DFilePathToURI.java64 StringBuilder buffer = new StringBuilder(len*3); in filepath2URI() local
65 buffer.append("file://"); in filepath2URI()
70 buffer.append('/'); in filepath2URI()
82 buffer.append('%'); in filepath2URI()
83 buffer.append(gAfterEscaping1[ch]); in filepath2URI()
84 buffer.append(gAfterEscaping2[ch]); in filepath2URI()
88 buffer.append((char)ch); in filepath2URI()
111 buffer.append('%'); in filepath2URI()
112 buffer.append(gHexChs[ch >> 4]); in filepath2URI()
113 buffer.append(gHexChs[ch & 0xf]); in filepath2URI()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DStringBufferTest.java33 StringBuffer buffer = new StringBuffer("abcde"); in test_setLengthI() local
35 buffer.setLength(-1); in test_setLengthI()
41 assertEquals("abcde", buffer.toString()); in test_setLengthI()
42 buffer.setLength(1); in test_setLengthI()
43 buffer.append('f'); in test_setLengthI()
44 assertEquals("af", buffer.toString()); in test_setLengthI()
46 buffer = new StringBuffer("abcde"); in test_setLengthI()
47 assertEquals("cde", buffer.substring(2)); in test_setLengthI()
48 buffer.setLength(3); in test_setLengthI()
49 buffer.append('f'); in test_setLengthI()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_OutputStream.java17 private byte[] buffer; field in Support_OutputStream
35 buffer = new byte[bufferSize]; in Support_OutputStream()
58 public void write(byte buffer[]) throws IOException { in write() argument
62 for (int i = 0; i < buffer.length; i++) { in write()
63 write(buffer[i]); in write()
68 public void write(byte buffer[], int offset, int count) throws IOException { in write() argument
72 if (offset < 0 || count < 0 || (offset + count) > buffer.length) { in write()
76 write(buffer[i]); in write()
86 buffer[position] = (byte)(oneByte & 255); in write()
95 System.arraycopy(buffer, 0, toReturn, 0, position); in toByteArray()
[all …]
DStreams.java37 byte[] buffer = new byte[1024]; in streamToBytes()
40 while ((count = source.read(buffer)) != -1) { in streamToBytes()
41 out.write(buffer, 0, count); in streamToBytes()
50 char[] buffer = new char[1024]; in streamToString() local
53 while ((count = fileReader.read(buffer)) != -1) { in streamToString()
54 out.write(buffer, 0, count); in streamToString()
/libcore/luni/src/main/java/org/apache/harmony/xml/dom/
DCharacterDataImpl.java35 protected StringBuffer buffer; field in CharacterDataImpl
43 buffer.append(arg); in appendData()
47 buffer.delete(offset, offset + count); in deleteData()
51 return buffer.toString(); in getData()
58 stringBuilder.append(buffer); in appendDataTo()
62 return buffer.length(); in getLength()
72 buffer.insert(offset, arg); in insertData()
81 buffer.replace(offset, offset + count, arg); in replaceData()
88 buffer = new StringBuffer(data); in setData()
93 return buffer.substring(offset, offset + count); in substringData()
/libcore/luni/src/main/java/java/text/
DMessageFormat.java387 StringBuffer buffer = new StringBuffer(); in applyPattern() local
395 if (Format.upTo(template, position, buffer, '{')) { in applyPattern()
427 localStrings.add(buffer.toString()); in applyPattern()
428 buffer.setLength(0); in applyPattern()
512 StringBuffer buffer = new StringBuffer(); in formatToCharacterIterator() local
516 formatImpl((Object[]) object, buffer, new FieldPosition(0), fields); in formatToCharacterIterator() local
519 AttributedString as = new AttributedString(buffer.toString()); in formatToCharacterIterator()
548 public final StringBuffer format(Object[] objects, StringBuffer buffer, in format() argument
550 return formatImpl(objects, buffer, field, null); in format()
553 private StringBuffer formatImpl(Object[] objects, StringBuffer buffer, in formatImpl() argument
[all …]
DChoiceFormat.java127 StringBuffer buffer = new StringBuffer(); in applyPattern() local
176 buffer.setLength(0); in applyPattern()
178 upTo(template, position, buffer, '|'); in applyPattern()
181 formats.add(buffer.toString()); in applyPattern()
238 public StringBuffer format(double value, StringBuffer buffer, in format() argument
242 return buffer.append(choiceFormats[i]); in format()
245 return choiceFormats.length == 0 ? buffer : buffer in format()
262 public StringBuffer format(long value, StringBuffer buffer, in format() argument
264 return format((double) value, buffer, field); in format()
451 StringBuilder buffer = new StringBuilder(); in toPattern() local
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldOutputStreamTest.java28 private byte[] buffer; field in OldOutputStreamTest.BasicOutputStream
32 buffer = new byte[BUFFER_SIZE]; in BasicOutputStream()
38 buffer[position] = (byte) (oneByte & 255); in write()
46 return buffer; in getBuffer()
56 byte[] buffer; in test_write$B()
65 buffer = bos.getBuffer(); in test_write$B()
67 expected = (shortByteArray[i] == buffer[i]); in test_write$B()
81 byte[] buffer; in test_write$BII()
90 buffer = bos.getBuffer(); in test_write$BII()
92 expected = (shortByteArray[i] == buffer[j]); in test_write$BII()
/libcore/dex/src/main/java/com/android/dex/
DClassDef.java24 private final Dex buffer; field in ClassDef
35 public ClassDef(Dex buffer, int offset, int typeIndex, int accessFlags, in ClassDef() argument
38 this.buffer = buffer; in ClassDef()
67 return buffer.readTypeList(interfacesOffset).getTypes(); in getInterfaces()
91 if (buffer == null) { in toString()
96 result.append(buffer.typeNames().get(typeIndex)); in toString()
98 result.append(" extends ").append(buffer.typeNames().get(supertypeIndex)); in toString()
/libcore/luni/src/test/java/libcore/java/util/zip/
DDeflaterInputStreamTest.java55 byte[] buffer = new byte[1024]; in inflate()
57 while ((count = in.read(buffer)) != -1) { in inflate()
58 out.write(buffer, 0, count); in inflate()
65 byte[] buffer = new byte[8]; in testReadWithBuffer()
70 while ((count = in.read(buffer, 0, 5)) != -1) { in testReadWithBuffer()
72 out.write(buffer, 0, count); in testReadWithBuffer()
88 byte[] buffer = new byte[8]; in testReadExceptions()
91 in.read(buffer, 0, 10); in testReadExceptions()
101 in.read(buffer, -1, 5); in testReadExceptions()
107 in.read(buffer, 0, 5); in testReadExceptions()
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
DBerInputStream.java39 protected byte[] buffer; field in BerInputStream
89 this.buffer = encoded; in BerInputStream()
117 buffer = new byte[initialSize]; in BerInputStream()
124 if (buffer.length < (length + offset)) { in BerInputStream()
126 System.arraycopy(buffer, 0, newBuffer, 0, offset); in BerInputStream()
127 buffer = newBuffer; in BerInputStream()
142 buffer = encoded; in reset()
221 if (buffer[contentOffset] > 7) { in readBitString()
226 if (length == 1 && buffer[contentOffset] != 0) { in readBitString()
256 int bits = buffer[contentOffset] & 0xFF; in readEnumerated()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DASCCharsetDecoderTest.java58 ByteBuffer buffer = ByteBuffer.allocate(8); in getMalformedByteBuffer() local
59 buffer.put((byte) -1); in getMalformedByteBuffer()
60 buffer.put(getByteBuffer()); in getMalformedByteBuffer()
61 buffer.flip(); in getMalformedByteBuffer()
62 return buffer; in getMalformedByteBuffer()
DGBCharsetDecoderTest.java53 ByteBuffer buffer = ByteBuffer.allocate(20); in getMalformedByteBuffer() local
54 buffer.put(new byte[] { (byte) 0xd8 }); in getMalformedByteBuffer()
55 buffer.put(getByteBuffer()); in getMalformedByteBuffer()
56 buffer.flip(); in getMalformedByteBuffer()
57 return buffer; in getMalformedByteBuffer()
/libcore/luni/src/main/java/java/util/logging/
DMemoryHandler.java73 private LogRecord[] buffer; field in MemoryHandler
123 buffer = new LogRecord[size]; in MemoryHandler()
154 buffer = new LogRecord[size]; in MemoryHandler()
193 buffer[cursor++] = record; in publish()
233 if (buffer[i] != null) { in push()
234 target.publish(buffer[i]); in push()
236 buffer[i] = null; in push()
239 if (buffer[i] != null) { in push()
240 target.publish(buffer[i]); in push()
242 buffer[i] = null; in push()

12345678