Home
last modified time | relevance | path

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

12345

/thrift-3.4.0/lib/cpp/test/
DTBufferBaseTest.cpp182 TMemoryBuffer buffer(16); in BOOST_AUTO_TEST_CASE() local
187 buffer.write(&data[offset], d1[index]); in BOOST_AUTO_TEST_CASE()
192 string output = buffer.getBufferAsString(); in BOOST_AUTO_TEST_CASE()
202 TMemoryBuffer buffer(16); in BOOST_AUTO_TEST_CASE() local
210 buffer.write(&data[offset], d1[index]); in BOOST_AUTO_TEST_CASE()
218 unsigned int got = buffer.read(&data_out[offset], d2[index]); in BOOST_AUTO_TEST_CASE()
234 TMemoryBuffer buffer(16); in BOOST_AUTO_TEST_CASE() local
242 buffer.write(&data[offset], d1[index]); in BOOST_AUTO_TEST_CASE()
250 unsigned int got = buffer.readAppendToString(output, d2[index]); in BOOST_AUTO_TEST_CASE()
268 TMemoryBuffer buffer(16); in BOOST_AUTO_TEST_CASE() local
[all …]
DThrifttReadCheckTests.cpp69 uint8_t buffer[6] = {1, 2, 3, 4, 5, 6}; in BOOST_AUTO_TEST_CASE() local
70 trans_out.write((const uint8_t*)buffer, sizeof(buffer)); in BOOST_AUTO_TEST_CASE()
74 memset(buffer, 0, sizeof(buffer)); in BOOST_AUTO_TEST_CASE()
75 BOOST_CHECK_THROW(trans_in.read(buffer, sizeof(buffer)), TTransportException); in BOOST_AUTO_TEST_CASE()
85 uint8_t buffer[4]; in BOOST_AUTO_TEST_CASE() local
88 BOOST_CHECK_THROW(trans->read(buffer, sizeof(buffer)), TTransportException); in BOOST_AUTO_TEST_CASE()
89 BOOST_CHECK_THROW(trans->readAll(buffer, sizeof(buffer)), TTransportException); in BOOST_AUTO_TEST_CASE()
93 BOOST_CHECK_THROW(trans->read(buffer, sizeof(buffer)), TTransportException); in BOOST_AUTO_TEST_CASE()
94 BOOST_CHECK_THROW(trans->readAll(buffer, sizeof(buffer)), TTransportException); in BOOST_AUTO_TEST_CASE()
101 uint8_t buffer[6] = {1, 2, 3, 4, 5, 6}; in BOOST_AUTO_TEST_CASE() local
[all …]
DTPipedTransportTest.cpp38 uint8_t buffer[4]; in BOOST_AUTO_TEST_CASE() local
41 trans->readAll(buffer, 2); in BOOST_AUTO_TEST_CASE()
42 BOOST_CHECK(std::string((char*)buffer, 2) == "ab"); in BOOST_AUTO_TEST_CASE()
47 trans->readAll(buffer, 2); in BOOST_AUTO_TEST_CASE()
48 BOOST_CHECK(std::string((char*)buffer, 2) == "cd"); in BOOST_AUTO_TEST_CASE()
49 trans->readAll(buffer, 2); in BOOST_AUTO_TEST_CASE()
50 BOOST_CHECK(std::string((char*)buffer, 2) == "ef"); in BOOST_AUTO_TEST_CASE()
DJSONProtoTest.cpp188 std::shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer()); in BOOST_AUTO_TEST_CASE() local
189 std::shared_ptr<TJSONProtocol> proto(new TJSONProtocol(buffer)); in BOOST_AUTO_TEST_CASE()
201 std::shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer()); in BOOST_AUTO_TEST_CASE() local
202 std::shared_ptr<TJSONProtocol> proto(new TJSONProtocol(buffer)); in BOOST_AUTO_TEST_CASE()
232 std::shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer()); in BOOST_AUTO_TEST_CASE() local
233 std::shared_ptr<TJSONProtocol> proto(new TJSONProtocol(buffer)); in BOOST_AUTO_TEST_CASE()
248 std::shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer()); in BOOST_AUTO_TEST_CASE() local
249 std::shared_ptr<TJSONProtocol> proto(new TJSONProtocol(buffer)); in BOOST_AUTO_TEST_CASE()
277 std::shared_ptr<TMemoryBuffer> buffer(new TMemoryBuffer( in BOOST_AUTO_TEST_CASE() local
279 std::shared_ptr<TJSONProtocol> proto(new TJSONProtocol(buffer)); in BOOST_AUTO_TEST_CASE()
[all …]
/thrift-3.4.0/lib/netstd/Thrift/Transport/
DTTransport.cs82 protected static void ValidateBufferArgs(byte[] buffer, int offset, int length) in ValidateBufferArgs() argument
84 if (buffer == null) in ValidateBufferArgs()
86 throw new ArgumentNullException(nameof(buffer)); in ValidateBufferArgs()
100 if (offset + length > buffer.Length) in ValidateBufferArgs()
102 throw new ArgumentOutOfRangeException(nameof(buffer), "Not enough data"); in ValidateBufferArgs()
108 …public abstract ValueTask<int> ReadAsync(byte[] buffer, int offset, int length, CancellationToken … in ReadAsync() argument
110 …public virtual async ValueTask<int> ReadAllAsync(byte[] buffer, int offset, int length, Cancellati… in ReadAllAsync() argument
114 ValidateBufferArgs(buffer, offset, length); in ReadAllAsync()
122 buffer[offset++] = _peekBuffer[0]; in ReadAllAsync()
135 var numBytes = await ReadAsync(buffer, offset, remaining, cancellationToken); in ReadAllAsync()
[all …]
/thrift-3.4.0/lib/rb/lib/thrift/
Dbytes.rb46 def self.force_binary_encoding(buffer) argument
47 buffer = buffer.dup if buffer.frozen?
48 buffer.force_encoding(Encoding::BINARY)
107 def self.force_binary_encoding(buffer) argument
108 buffer
/thrift-3.4.0/lib/erl/src/
Dthrift_membuffer_transport.erl31 buffer = []
44 State = #t_membuffer{buffer = Buf},
47 State = #t_membuffer{buffer = [Buf]},
54 read(State = #t_membuffer{buffer = Buf}, Len)
59 {State#t_membuffer{buffer = Remaining}, {ok, Result}}.
62 read_exact(State = #t_membuffer{buffer = Buf}, Len)
68 {State#t_membuffer{buffer = Remaining}, {ok, Result}};
74 write(State = #t_membuffer{buffer = Buf}, Data)
76 {State#t_membuffer{buffer = [Buf, Data]}, ok}.
Dthrift_socket_transport.erl35 buffer = []
66 read(State = #t_socket{buffer = Buf}, Len)
72 {State#t_socket{buffer = Remaining}, {ok, Result}};
78 loop_recv(State=#t_socket{buffer = Buf},ReadLen,NextReadLen) when NextReadLen =< 0->
80 {State#t_socket{buffer = Remaining},{ok,Result}};
82 loop_recv(State=#t_socket{socket = Socket,buffer = Buf},ReadLen,NextReadLen) when NextReadLen >0 ->
90 loop_recv(State#t_socket{buffer = Binary},ReadLen,ReadLen-Give)
93 recv(State = #t_socket{socket = Socket, buffer = Buf}, Len) ->
102 {State#t_socket{buffer = Remaining}, {ok, Result}}
106 read_exact(State = #t_socket{buffer = Buf}, Len)
[all …]
/thrift-3.4.0/lib/dart/lib/src/transport/
Dt_buffered_transport.dart26 Uint8List buffer = Uint8List.fromList(_writeBuffer);
28 return buffer;
58 int read(Uint8List buffer, int offset, int length) {
59 if (buffer == null) {
60 throw ArgumentError.notNull("buffer");
63 if (offset + length > buffer.length) {
64 throw ArgumentError("The range exceeds the buffer length");
73 buffer[offset + i] = _readIterator.current;
86 void write(Uint8List buffer, int offset, int length) {
87 if (buffer == null) {
[all …]
Dt_transport.dart32 /// Reads up to [length] bytes into [buffer], starting at [offset].
35 int read(Uint8List buffer, int offset, int length);
41 int readAll(Uint8List buffer, int offset, int length) {
45 ret = read(buffer, offset + got, length - got);
57 /// Writes up to [len] bytes from the buffer.
59 void write(Uint8List buffer, int offset, int length);
63 void writeAll(Uint8List buffer) {
64 write(buffer, 0, buffer.length);
67 /// Flush any pending data out of a transport buffer.
/thrift-3.4.0/lib/java/src/test/java/org/apache/thrift/transport/sasl/
DTestDataFrameReader.java37 ByteBuffer buffer = in testRead() local
39 buffer.putInt(payloadSize); in testRead()
41 buffer.put((byte) i); in testRead()
43 buffer.rewind(); in testRead()
52 transport.reset(buffer.array(), 0, 6); in testRead()
61 transport.reset(buffer.array(), 6, 21); in testRead()
64 buffer.position(DataFrameHeaderReader.PAYLOAD_LENGTH_BYTES); in testRead()
66 buffer, in testRead()
/thrift-3.4.0/lib/d/src/thrift/internal/test/
Dprotocol.d28 auto buffer = new TMemoryBuffer; variable
29 auto prot = new Protocol(buffer);
42 buffer.reset();
53 buffer.reset();
64 buffer.reset();
87 buffer.reset();
110 buffer.reset();
128 buffer.reset();
134 auto buffer = new TMemoryBuffer; variable
135 auto prot = new Protocol(buffer);
[all …]
/thrift-3.4.0/lib/lua/
DTMemoryBuffer.lua24 buffer = '',
40 return self.buffer
45 self.buffer = buf
48 self.buffer = ''
69 local val = string.sub(self.buffer, self.rPos + 1, self.rPos + len)
87 self.buffer = self.buffer .. buf
/thrift-3.4.0/lib/py/src/transport/
DTHeaderTransport.py231 def _parse_header_format(self, buffer): argument
234 buffer_transport._buffer = buffer
236 buffer.read(2) # discard the magic bytes
237 self.flags, = U16.unpack(buffer.read(U16.size))
238 self.sequence_id, = I32.unpack(buffer.read(I32.size))
240 header_length = U16.unpack(buffer.read(U16.size))[0] * 4
241 end_of_headers = buffer.tell() + header_length
242 if end_of_headers > len(buffer.getvalue()):
263 while buffer.tell() < end_of_headers:
276 buffer.seek(end_of_headers)
[all …]
/thrift-3.4.0/lib/java/src/test/java/org/apache/thrift/protocol/
DTestTJSONProtocol.java44 TMemoryBuffer buffer = new TMemoryBuffer(1000); in testEscapedUnicode() local
45 TJSONProtocol protocol = new TJSONProtocol(buffer); in testEscapedUnicode()
46 buffer.write(jsonString.getBytes(StandardCharsets.UTF_8)); in testEscapedUnicode()
57 TMemoryBuffer buffer = new TMemoryBuffer(inputString.length() + 2); in testExactlySizedBuffer() local
59 TJSONProtocol protocol = new TJSONProtocol(buffer); in testExactlySizedBuffer()
/thrift-3.4.0/lib/netstd/Thrift/Transport/Layered/
DTBufferedTransport.cs86 …public override async ValueTask<int> ReadAsync(byte[] buffer, int offset, int length, Cancellation… in ReadAsync() argument
89 ValidateBufferArgs(buffer, offset, length); in ReadAsync()
101 return await ReadBuffer.ReadAsync(buffer, offset, length, cancellationToken); in ReadAsync()
108 return await InnerTransport.ReadAsync(buffer, offset, length, cancellationToken); in ReadAsync()
118 return await ReadBuffer.ReadAsync(buffer, offset, length, cancellationToken); in ReadAsync()
122 …public override async Task WriteAsync(byte[] buffer, int offset, int length, CancellationToken can… in WriteAsync() argument
125 ValidateBufferArgs(buffer, offset, length); in WriteAsync()
145 await WriteBuffer.WriteAsync(buffer, offset, length, cancellationToken); in WriteAsync()
150 await InnerTransport.WriteAsync(buffer, offset, length, cancellationToken); in WriteAsync()
/thrift-3.4.0/lib/netstd/Thrift/Transport/Client/
DTStreamTransport.cs76 …public override async ValueTask<int> ReadAsync(byte[] buffer, int offset, int length, Cancellation… in ReadAsync() argument
85 return await InputStream.ReadAsync(buffer, offset, length, cancellationToken); in ReadAsync()
87 … return await InputStream.ReadAsync(new Memory<byte>(buffer, offset, length), cancellationToken); in ReadAsync()
91 …public override async Task WriteAsync(byte[] buffer, int offset, int length, CancellationToken can… in WriteAsync() argument
100 await OutputStream.WriteAsync(buffer, offset, length, cancellationToken); in WriteAsync()
102 await OutputStream.WriteAsync(buffer.AsMemory(offset, length), cancellationToken); in WriteAsync()
DTMemoryBufferTransport.cs122 …public override ValueTask<int> ReadAsync(byte[] buffer, int offset, int length, CancellationToken … in ReadAsync() argument
125 Buffer.BlockCopy(Bytes, Position, buffer, offset, count); in ReadAsync()
131 public override Task WriteAsync(byte[] buffer, CancellationToken cancellationToken) in WriteAsync() argument
133 return WriteAsync(buffer, 0, buffer.Length, cancellationToken); in WriteAsync()
136 …public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellati… in WriteAsync() argument
140 Buffer.BlockCopy(buffer, offset, Bytes, Position, count); in WriteAsync()
DTNamedPipeTransport.cs71 …public override async ValueTask<int> ReadAsync(byte[] buffer, int offset, int length, Cancellation… in ReadAsync() argument
80 var numRead = await PipeStream.ReadAsync(buffer, offset, length, cancellationToken); in ReadAsync()
82 …var numRead = await PipeStream.ReadAsync(new Memory<byte>(buffer, offset, length), cancellationTok… in ReadAsync()
88 …public override async Task WriteAsync(byte[] buffer, int offset, int length, CancellationToken can… in WriteAsync() argument
102 await PipeStream.WriteAsync(buffer, offset, nBytes, cancellationToken); in WriteAsync()
104 await PipeStream.WriteAsync(buffer.AsMemory(offset, nBytes), cancellationToken); in WriteAsync()
/thrift-3.4.0/lib/java/src/main/java/org/apache/thrift/partial/
DThriftStructProcessor.java101 public Object prepareString(ByteBuffer buffer) { in prepareString() argument
102 return byteBufferToString(buffer); in prepareString()
106 public Object prepareBinary(ByteBuffer buffer) { in prepareBinary() argument
107 return buffer; in prepareBinary()
146 public void setString(TBase valueCollection, TFieldIdEnum fieldId, ByteBuffer buffer) { in setString() argument
147 String value = byteBufferToString(buffer); in setString()
176 private static String byteBufferToString(ByteBuffer buffer) { in byteBufferToString() argument
177 byte[] bytes = buffer.array(); in byteBufferToString()
178 int pos = buffer.position(); in byteBufferToString()
179 return new String(bytes, pos, buffer.limit() - pos, StandardCharsets.UTF_8); in byteBufferToString()
/thrift-3.4.0/lib/rb/lib/thrift/transport/
Dmemory_buffer_transport.rb30 def initialize(buffer = nil) argument
31 @buf = buffer ? Bytes.force_binary_encoding(buffer) : Bytes.empty_byte_buffer
84 def read_into_buffer(buffer, size) argument
91 Bytes.set_string_byte(buffer, i, byte)
/thrift-3.4.0/lib/haxe/src/org/apache/thrift/protocol/
DTBinaryProtocol.hx246 var buffer = new BytesBuffer(); variable
247 var len = Transport.readAll( buffer, 0, 1);
248 var inp = new BytesInput( buffer.getBytes(), 0, 1);
254 var buffer = new BytesBuffer(); variable
255 var len = Transport.readAll( buffer, 0, 2);
256 var inp = new BytesInput( buffer.getBytes(), 0, 2);
262 var buffer = new BytesBuffer(); variable
263 var len = Transport.readAll( buffer, 0, 4);
264 var inp = new BytesInput( buffer.getBytes(), 0, 4);
270 var buffer = new BytesBuffer(); variable
[all …]
/thrift-3.4.0/lib/perl/lib/Thrift/
DMemoryBuffer.pm38 buffer => '',
72 return $self->{buffer};
81 $self->{buffer} = $new_buffer;
106 $ret = substr($self->{buffer},$self->{rPos},$give);
139 $self->{buffer} .= $buf;
/thrift-3.4.0/lib/go/thrift/
Dzlib_transport_test.go46 buffer := NewTMemoryBuffer()
47 trans, err := factory.GetTransport(buffer)
56 buffer := NewTMemoryBuffer()
57 trans, err := factory.GetTransport(buffer)
/thrift-3.4.0/lib/d/src/thrift/transport/
Dpiped.d199 ubyte[4] buffer;
200 trans.readAll(buffer[0 .. 2]);
201 enforce(buffer[0 .. 2] == "ab");
209 trans.readAll(buffer[0 .. 2]);
210 enforce(buffer[0 .. 2] == "cd");
213 trans.readAll(buffer[0 .. 2]);
214 enforce(buffer[0 .. 2] == "ef");

12345