Home
last modified time | relevance | path

Searched refs:sink (Results 1 – 25 of 234) sorted by relevance

12345678910

/external/okhttp/okio/okio/src/test/java/okio/
DBufferedSinkTest.java75 private BufferedSink sink;
79 sink = factory.create(data);
83 sink.writeUtf8("");
84 sink.flush();
89 sink.writeByte(0xab);
90 sink.writeByte(0xcd);
91 sink.flush();
96 sink.writeUtf8(repeat('a', Segment.SIZE - 1));
97 sink.writeByte(0x20);
98 sink.writeByte(0x21);
[all …]
DBufferedSourceTest.java44 result.sink = buffer;
58 result.sink = buffer;
72 result.sink = buffer;
74 @Override public long read(Buffer sink, long byteCount) throws IOException {
75 return super.read(sink, Math.min(byteCount, 1L));
91 BufferedSink sink; field in BufferedSourceTest.Pipe
109 private BufferedSink sink; field in BufferedSourceTest
114 sink = pipe.sink; in setUp()
119 sink.write(new byte[] { (byte) 0xab, (byte) 0xcd }); in readBytes()
126 sink.write(new byte[] { in readShort()
[all …]
DOkioTest.java38 BufferedSink sink = Okio.buffer(Okio.sink(file)); in readWriteFile() local
39 sink.writeUtf8("Hello, java.io file!"); in readWriteFile()
40 sink.close(); in readWriteFile()
52 BufferedSink sink = Okio.buffer(Okio.appendingSink(file)); in appendFile() local
53 sink.writeUtf8("Hello, "); in appendFile()
54 sink.close(); in appendFile()
58 sink = Okio.buffer(Okio.appendingSink(file)); in appendFile()
59 sink.writeUtf8("java.io file!"); in appendFile()
60 sink.close(); in appendFile()
91 Sink sink = Okio.sink(out); in sinkFromOutputStream() local
[all …]
DRealBufferedSinkTest.java32 RealBufferedSink sink = new RealBufferedSink(new Buffer()); in inputStreamCloses() local
33 OutputStream out = sink.outputStream(); in inputStreamCloses()
36 sink.writeUtf8("Hi!"); in inputStreamCloses()
44 Buffer sink = new Buffer(); in bufferedSinkEmitsTailWhenItIsComplete() local
45 BufferedSink bufferedSink = new RealBufferedSink(sink); in bufferedSinkEmitsTailWhenItIsComplete()
47 assertEquals(0, sink.size()); in bufferedSinkEmitsTailWhenItIsComplete()
49 assertEquals(Segment.SIZE, sink.size()); in bufferedSinkEmitsTailWhenItIsComplete()
54 Buffer sink = new Buffer(); in bufferedSinkEmitMultipleSegments() local
55 BufferedSink bufferedSink = new RealBufferedSink(sink); in bufferedSinkEmitMultipleSegments()
57 assertEquals(Segment.SIZE * 3, sink.size()); in bufferedSinkEmitMultipleSegments()
[all …]
DDeflaterSinkTest.java35 Buffer sink = new Buffer(); in deflateWithClose() local
36 DeflaterSink deflaterSink = new DeflaterSink(sink, new Deflater()); in deflateWithClose()
39 Buffer inflated = inflate(sink); in deflateWithClose()
47 Buffer sink = new Buffer(); in deflateWithSyncFlush() local
48 DeflaterSink deflaterSink = new DeflaterSink(sink, new Deflater()); in deflateWithSyncFlush()
51 Buffer inflated = inflate(sink); in deflateWithSyncFlush()
59 Buffer sink = new Buffer(); in deflateWellCompressed() local
60 DeflaterSink deflaterSink = new DeflaterSink(sink, new Deflater()); in deflateWellCompressed()
63 Buffer inflated = inflate(sink); in deflateWellCompressed()
71 Buffer sink = new Buffer(); in deflatePoorlyCompressed() local
[all …]
DBufferTest.java177 Buffer sink = new Buffer(); in writeSplitSourceBufferLeft() local
178 sink.writeUtf8(repeat('b', Segment.SIZE - 10)); in writeSplitSourceBufferLeft()
182 sink.write(source, writeSize); in writeSplitSourceBufferLeft()
184 assertEquals(asList(Segment.SIZE - 10, writeSize), sink.segmentSizes()); in writeSplitSourceBufferLeft()
192 Buffer sink = new Buffer(); in writeSplitSourceBufferRight() local
193 sink.writeUtf8(repeat('b', Segment.SIZE - 10)); in writeSplitSourceBufferRight()
197 sink.write(source, writeSize); in writeSplitSourceBufferRight()
199 assertEquals(asList(Segment.SIZE - 10, writeSize), sink.segmentSizes()); in writeSplitSourceBufferRight()
204 Buffer sink = new Buffer(); in writePrefixDoesntSplit() local
205 sink.writeUtf8(repeat('b', 10)); in writePrefixDoesntSplit()
[all …]
/external/guava/guava-tests/test/com/google/common/hash/
DAbstractStreamingHasherTest.java45 Sink sink = new Sink(4); // byte order insignificant here in testBytes() local
47 sink.putByte((byte) 1); in testBytes()
48 sink.putBytes(new byte[] { 2, 3, 4, 5, 6 }); in testBytes()
49 sink.putByte((byte) 7); in testBytes()
50 sink.putBytes(new byte[] {}); in testBytes()
51 sink.putBytes(new byte[] { 8 }); in testBytes()
52 sink.hash(); in testBytes()
53 sink.assertInvariants(8); in testBytes()
54 sink.assertBytes(expected); in testBytes()
58 Sink sink = new Sink(4); in testShort() local
[all …]
DHashTestUtils.java94 for (PrimitiveSink sink : sinks) { in PUT_BOOLEAN()
95 sink.putBoolean(value); in PUT_BOOLEAN()
102 for (PrimitiveSink sink : sinks) { in PUT_BYTE()
103 sink.putByte((byte) value); in PUT_BYTE()
110 for (PrimitiveSink sink : sinks) { in PUT_SHORT()
111 sink.putShort(value); in PUT_SHORT()
118 for (PrimitiveSink sink : sinks) { in PUT_CHAR()
119 sink.putChar(value); in PUT_CHAR()
126 for (PrimitiveSink sink : sinks) { in PUT_INT()
127 sink.putInt(value); in PUT_INT()
[all …]
/external/okhttp/okhttp-ws/src/main/java/com/squareup/okhttp/internal/ws/
DWebSocketWriter.java53 private final BufferedSink sink; field in WebSocketWriter
64 public WebSocketWriter(boolean isClient, BufferedSink sink, Random random) { in WebSocketWriter() argument
65 if (sink == null) throw new NullPointerException("sink == null"); in WebSocketWriter()
68 this.sink = sink; in WebSocketWriter()
78 synchronized (sink) { in writePing()
85 synchronized (sink) { in writePong()
111 synchronized (sink) { in writeClose()
130 sink.writeByte(b0); in writeControlFrame()
135 sink.writeByte(b1); in writeControlFrame()
138 sink.write(maskKey); in writeControlFrame()
[all …]
/external/guava/guava-tests/test/com/google/common/io/
DCharSinkTest.java40 private TestCharSink sink; field in CharSinkTest
44 sink = new TestCharSink(); in setUp()
48 Writer writer = sink.openBufferedStream(); in testOpenBufferedStream()
49 assertTrue(sink.wasStreamOpened()); in testOpenBufferedStream()
50 assertFalse(sink.wasStreamClosed()); in testOpenBufferedStream()
55 assertTrue(sink.wasStreamClosed()); in testOpenBufferedStream()
56 assertEquals(STRING, sink.getString()); in testOpenBufferedStream()
60 assertEquals("", sink.getString()); in testWrite_string()
61 sink.write(STRING); in testWrite_string()
63 assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); in testWrite_string()
[all …]
DByteSinkTest.java39 private TestByteSink sink; field in ByteSinkTest
43 sink = new TestByteSink(); in setUp()
47 OutputStream out = sink.openBufferedStream(); in testOpenBufferedStream()
48 assertTrue(sink.wasStreamOpened()); in testOpenBufferedStream()
49 assertFalse(sink.wasStreamClosed()); in testOpenBufferedStream()
54 assertTrue(sink.wasStreamClosed()); in testOpenBufferedStream()
55 assertArrayEquals(new byte[] {1, 2, 3, 4}, sink.getBytes()); in testOpenBufferedStream()
59 assertArrayEquals(new byte[0], sink.getBytes()); in testWrite_bytes()
60 sink.write(bytes); in testWrite_bytes()
62 assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed()); in testWrite_bytes()
[all …]
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/spdy/
DSpdy3.java102 @Override public FrameWriter newWriter(BufferedSink sink, boolean client) { in newWriter() argument
103 return new Writer(sink, client); in newWriter()
288 private final BufferedSink sink; field in Spdy3.Writer
294 Writer(BufferedSink sink, boolean client) { in Writer() argument
295 this.sink = sink; in Writer()
320 sink.flush(); in flush()
333 sink.writeInt(0x80000000 | (VERSION & 0x7fff) << 16 | type & 0xffff); in synStream()
334 sink.writeInt((flags & 0xff) << 24 | length & 0xffffff); in synStream()
335 sink.writeInt(streamId & 0x7fffffff); in synStream()
336 sink.writeInt(associatedStreamId & 0x7fffffff); in synStream()
[all …]
DHttp2.java83 @Override public FrameWriter newWriter(BufferedSink sink, boolean client) { in newWriter() argument
84 return new Writer(sink, client); in newWriter()
364 private final BufferedSink sink; field in Http2.Writer
371 Writer(BufferedSink sink, boolean client) { in Writer() argument
372 this.sink = sink; in Writer()
381 sink.flush(); in flush()
392 sink.flush(); in ackSettings()
401 sink.write(CONNECTION_PREFACE.toByteArray()); in connectionPreface()
402 sink.flush(); in connectionPreface()
436 sink.writeInt(promisedStreamId & 0x7fffffff); in pushPromise()
[all …]
/external/okhttp/okio/okio/src/main/java/okio/
DSegment.java134 public void writeTo(Segment sink, int byteCount) { in writeTo() argument
135 if (!sink.owner) throw new IllegalArgumentException(); in writeTo()
136 if (sink.limit + byteCount > SIZE) { in writeTo()
138 if (sink.shared) throw new IllegalArgumentException(); in writeTo()
139 if (sink.limit + byteCount - sink.pos > SIZE) throw new IllegalArgumentException(); in writeTo()
140 System.arraycopy(sink.data, sink.pos, sink.data, 0, sink.limit - sink.pos); in writeTo()
141 sink.limit -= sink.pos; in writeTo()
142 sink.pos = 0; in writeTo()
145 System.arraycopy(data, pos, sink.data, sink.limit, byteCount); in writeTo()
146 sink.limit += byteCount; in writeTo()
DOkio.java55 public static BufferedSink buffer(Sink sink) { in buffer() argument
56 if (sink == null) throw new IllegalArgumentException("sink == null"); in buffer()
57 return new RealBufferedSink(sink); in buffer()
61 public static Sink sink(final OutputStream out) { in sink() method in Okio
62 return sink(out, new Timeout()); in sink()
65 private static Sink sink(final OutputStream out, final Timeout timeout) { in sink() method in Okio
112 public static Sink sink(final Socket socket) throws IOException {
115 Sink sink = sink(socket.getOutputStream(), timeout);
116 return timeout.sink(sink);
129 @Override public long read(Buffer sink, long byteCount) throws IOException {
[all …]
DDeflaterSink.java38 private final BufferedSink sink; field in DeflaterSink
42 public DeflaterSink(Sink sink, Deflater deflater) { in DeflaterSink() argument
43 this(Okio.buffer(sink), deflater); in DeflaterSink()
51 DeflaterSink(BufferedSink sink, Deflater deflater) { in DeflaterSink() argument
52 if (sink == null) throw new IllegalArgumentException("source == null"); in DeflaterSink()
54 this.sink = sink; in DeflaterSink()
86 Buffer buffer = sink.buffer(); in deflate()
101 sink.emitCompleteSegments(); in deflate()
115 sink.flush(); in flush()
142 sink.close(); in close()
[all …]
DGzipSink.java40 private final BufferedSink sink; field in GzipSink
56 public GzipSink(Sink sink) { in GzipSink() argument
57 if (sink == null) throw new IllegalArgumentException("sink == null"); in GzipSink()
59 this.sink = Okio.buffer(sink); in GzipSink()
60 this.deflaterSink = new DeflaterSink(this.sink, deflater); in GzipSink()
78 return sink.timeout(); in timeout()
104 sink.close(); in close()
115 Buffer buffer = this.sink.buffer(); in writeHeader()
125 sink.writeIntLe((int) crc.getValue()); // CRC of original data. in writeFooter()
126 sink.writeIntLe(deflater.getTotalIn()); // Length of original data. in writeFooter()
DRealBufferedSource.java44 @Override public long read(Buffer sink, long byteCount) throws IOException { in read() argument
45 if (sink == null) throw new IllegalArgumentException("sink == null"); in read()
55 return buffer.read(sink, toRead); in read()
101 @Override public int read(byte[] sink) throws IOException { in read() argument
102 return read(sink, 0, sink.length); in read()
105 @Override public void readFully(byte[] sink) throws IOException { in readFully() argument
107 require(sink.length); in readFully()
112 int read = buffer.read(sink, offset, (int) buffer.size); in readFully()
118 buffer.readFully(sink); in readFully()
121 @Override public int read(byte[] sink, int offset, int byteCount) throws IOException { in read() argument
[all …]
DRealBufferedSink.java25 public final Sink sink; field in RealBufferedSink
28 public RealBufferedSink(Sink sink, Buffer buffer) { in RealBufferedSink() argument
29 if (sink == null) throw new IllegalArgumentException("sink == null"); in RealBufferedSink()
31 this.sink = sink; in RealBufferedSink()
34 public RealBufferedSink(Sink sink) { in RealBufferedSink() argument
35 this(sink, new Buffer()); in RealBufferedSink()
176 if (byteCount > 0) sink.write(buffer, byteCount); in emitCompleteSegments()
183 if (byteCount > 0) sink.write(buffer, byteCount); in emit()
221 sink.write(buffer, buffer.size);
223 sink.flush();
[all …]
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/
DMultipartBuilder.java229 private long writeOrCountBytes(BufferedSink sink, boolean countBytes) throws IOException { in writeOrCountBytes() argument
234 sink = byteCountBuffer = new Buffer(); in writeOrCountBytes()
241 sink.write(DASHDASH); in writeOrCountBytes()
242 sink.write(boundary); in writeOrCountBytes()
243 sink.write(CRLF); in writeOrCountBytes()
247 sink.writeUtf8(headers.name(h)) in writeOrCountBytes()
256 sink.writeUtf8("Content-Type: ") in writeOrCountBytes()
263 sink.writeUtf8("Content-Length: ") in writeOrCountBytes()
272 sink.write(CRLF); in writeOrCountBytes()
277 partBodies.get(p).writeTo(sink); in writeOrCountBytes()
[all …]
DCache.java557 BufferedSink sink = Okio.buffer(editor.newSink(ENTRY_METADATA)); in writeTo() local
559 sink.writeUtf8(url); in writeTo()
560 sink.writeByte('\n'); in writeTo()
561 sink.writeUtf8(requestMethod); in writeTo()
562 sink.writeByte('\n'); in writeTo()
563 sink.writeDecimalLong(varyHeaders.size()); in writeTo()
564 sink.writeByte('\n'); in writeTo()
566 sink.writeUtf8(varyHeaders.name(i)); in writeTo()
567 sink.writeUtf8(": "); in writeTo()
568 sink.writeUtf8(varyHeaders.value(i)); in writeTo()
[all …]
/external/icu/icu4c/source/test/intltest/
Dstrtest.cpp359 SimpleByteSink sink(buffer); in TestByteSink() local
360 sink.Append("abc", 3); in TestByteSink()
361 sink.Flush(); in TestByteSink()
362 if(!(sink.length() == 4 && 0 == memcmp("abcz", buffer, 4) && buffer[4] == '!')) { in TestByteSink()
368 char *dest = sink.GetAppendBuffer(0, 50, scratch, (int32_t)sizeof(scratch), &capacity); in TestByteSink()
373 dest = sink.GetAppendBuffer(10, 50, scratch, 9, &capacity); in TestByteSink()
378 dest = sink.GetAppendBuffer(5, 50, scratch, (int32_t)sizeof(scratch), &capacity); in TestByteSink()
388 CheckedArrayByteSink sink(buffer, (int32_t)sizeof(buffer)); in TestCheckedArrayByteSink() local
389 sink.Append("abc", 3); in TestCheckedArrayByteSink()
390 if(!(sink.NumberOfBytesAppended() == 3 && sink.NumberOfBytesWritten() == 3 && in TestCheckedArrayByteSink()
[all …]
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/
DHttpConnection.java80 private final BufferedSink sink; field in HttpConnection
91 this.sink = Okio.buffer(Okio.sink(socket)); in HttpConnection()
99 sink.timeout().timeout(writeTimeoutMillis, MILLISECONDS); in setTimeouts()
141 sink.flush(); in flush()
172 sink.writeUtf8(requestLine).writeUtf8("\r\n"); in writeRequest()
174 sink.writeUtf8(headers.name(i)) in writeRequest()
179 sink.writeUtf8("\r\n"); in writeRequest()
240 requestBody.writeToSocket(sink); in writeRequestBody()
262 return sink; in rawSink()
283 private final ForwardingTimeout timeout = new ForwardingTimeout(sink.timeout());
[all …]
/external/skia/src/views/
DSkEventSink.cpp55 SkEventSink* sink = globals.fSinkHead; in ~SkEventSink() local
59 SkEventSink* next = sink->fNextSink; in ~SkEventSink()
60 if (sink == this) { in ~SkEventSink()
68 prev = sink; in ~SkEventSink()
69 sink = next; in ~SkEventSink()
164 void SkEventSink::copyListeners(const SkEventSink& sink) in copyListeners() argument
166 SkListenersTagList* sinkList = (SkListenersTagList*)sink.findTagList(kListeners_SkTagList); in copyListeners()
228 SkEventSink* sink = SkEventSink::FindSink(evt.getTargetID()); in DoEvent() local
229 if (sink) { in DoEvent()
230 return sink->doEvent(evt) ? kHandled_EventResult : kNotHandled_EventResult; in DoEvent()
[all …]
/external/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/internal/ws/
DWebSocketWriterTest.java59 BufferedSink sink = serverWriter.newMessageSink(TEXT); in serverStreamSimpleHello() local
61 sink.writeUtf8("Hel").flush(); in serverStreamSimpleHello()
64 sink.writeUtf8("lo").flush(); in serverStreamSimpleHello()
67 sink.close(); in serverStreamSimpleHello()
72 BufferedSink sink = serverWriter.newMessageSink(TEXT); in serverStreamCloseFlushes() local
74 sink.writeUtf8("Hel").flush(); in serverStreamCloseFlushes()
77 sink.writeUtf8("lo").close(); in serverStreamCloseFlushes()
83 BufferedSink sink = clientWriter.newMessageSink(TEXT); in clientStreamSimpleHello() local
85 sink.writeUtf8("Hel").flush(); in clientStreamSimpleHello()
88 sink.writeUtf8("lo").flush(); in clientStreamSimpleHello()
[all …]

12345678910