/thrift-3.4.0/lib/netstd/Thrift/Protocol/Utilities/ |
D | TGuidExtensions.cs | 29 var bytes = self.ToByteArray(); in SwapByteOrder() 34 SwapBytes(ref bytes[0], ref bytes[3]); in SwapByteOrder() 35 SwapBytes(ref bytes[1], ref bytes[2]); in SwapByteOrder() 36 SwapBytes(ref bytes[4], ref bytes[5]); in SwapByteOrder() 37 SwapBytes(ref bytes[6], ref bytes[7]); in SwapByteOrder() 40 return new Guid(bytes); in SwapByteOrder() 66 var bytes = guid.ToByteArray(); in SelfTest() 70 Debug.Assert( bytes[i] == expected); in SelfTest()
|
/thrift-3.4.0/lib/java/src/main/java/org/apache/thrift/protocol/ |
D | TTupleProtocol.java | 47 byte[] bytes = toByteArray(bs, vectorWidth); in writeBitSet() 48 for (byte b : bytes) { in writeBitSet() 55 byte[] bytes = new byte[length]; in readBitSet() 57 bytes[j] = readByte(); in readBitSet() 59 BitSet bs = fromByteArray(bytes); in readBitSet() 64 public static BitSet fromByteArray(byte[] bytes) { in fromByteArray() argument 66 for (int i = 0; i < bytes.length * 8; i++) { in fromByteArray() 67 if ((bytes[bytes.length - i / 8 - 1] & (1 << (i % 8))) > 0) { in fromByteArray() 85 byte[] bytes = new byte[(int) Math.ceil(vectorWidth / 8.0)]; in toByteArray() 88 bytes[bytes.length - i / 8 - 1] |= 1 << (i % 8); in toByteArray() [all …]
|
D | TCompactProtocol.java | 354 byte[] bytes = str.getBytes(StandardCharsets.UTF_8); in writeString() 355 writeVarint32(bytes.length); in writeString() 356 trans_.write(bytes, 0, bytes.length); in writeString() 845 private long bytesToLong(byte[] bytes) { in bytesToLong() argument 846 return bytesToLong(bytes, 0); in bytesToLong() 849 private long bytesToLong(byte[] bytes, int offset) { in bytesToLong() argument 850 return ((bytes[offset + 7] & 0xffL) << 56) in bytesToLong() 851 | ((bytes[offset + 6] & 0xffL) << 48) in bytesToLong() 852 | ((bytes[offset + 5] & 0xffL) << 40) in bytesToLong() 853 | ((bytes[offset + 4] & 0xffL) << 32) in bytesToLong() [all …]
|
/thrift-3.4.0/lib/java/src/main/java/org/apache/thrift/utils/ |
D | StringUtils.java | 38 public static String bytesToHexString(byte[] bytes) { in bytesToHexString() argument 39 if (bytes == null) { in bytesToHexString() 42 return bytesToHexString(bytes, 0, bytes.length); in bytesToHexString() 53 public static String bytesToHexString(byte[] bytes, int offset, int length) { in bytesToHexString() argument 60 if (length > bytes.length - offset) { in bytesToHexString() 63 + bytes.length in bytesToHexString() 71 int unsignedInt = bytes[i + offset] & 0xFF; in bytesToHexString()
|
/thrift-3.4.0/lib/java/src/test/java/org/apache/thrift/utils/ |
D | TestStringUtils.java | 33 byte[] bytes = {0x00, 0x1A, (byte) 0xEF, (byte) 0xAB, (byte) 0x92}; in testToHexString() 34 assertEquals("001AEFAB92", StringUtils.bytesToHexString(bytes)); in testToHexString() 35 assertEquals("EFAB92", StringUtils.bytesToHexString(bytes, 2, 3)); in testToHexString() 39 private byte[] bytes; field in TestStringUtils 43 bytes = new byte[] {1, 2, 3, 4, 5}; in setUp() 48 assertThrows(IllegalArgumentException.class, () -> StringUtils.bytesToHexString(bytes, 0, -1)); in testNegativeLength() 53 assertThrows(IndexOutOfBoundsException.class, () -> StringUtils.bytesToHexString(bytes, -1, 1)); in testNegativeStartOffset() 58 assertThrows(IndexOutOfBoundsException.class, () -> StringUtils.bytesToHexString(bytes, 5, 1)); in testInvalidRange()
|
/thrift-3.4.0/lib/java/src/main/java/org/apache/thrift/ |
D | TDeserializer.java | 133 public void deserialize(TBase base, byte[] bytes) throws TException { in deserialize() argument 134 deserialize(base, bytes, 0, bytes.length); in deserialize() 146 public void deserialize(TBase base, byte[] bytes, int offset, int length) throws TException { in deserialize() argument 148 this.partialDeserializeThriftObject(base, bytes, offset, length); in deserialize() 151 trans_.reset(bytes, offset, length); in deserialize() 189 TBase tb, byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum... fieldIdPathRest) in partialDeserialize() argument 192 if (locateField(bytes, fieldIdPathFirst, fieldIdPathRest) != null) { in partialDeserialize() 214 byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum... fieldIdPathRest) in partialDeserializeBool() argument 216 return (Boolean) partialDeserializeField(TType.BOOL, bytes, fieldIdPathFirst, fieldIdPathRest); in partialDeserializeBool() 229 byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum... fieldIdPathRest) in partialDeserializeByte() argument [all …]
|
/thrift-3.4.0/lib/d/src/thrift/internal/ |
D | endian.d | 29 ubyte[T.sizeof] bytes; in IntBuf() 62 s.bytes = [1, 2]; 64 enforce(s.bytes == [2, 1]); 67 i.bytes = [1, 2, 3, 4]; 69 enforce(i.bytes == [4, 3, 2, 1]); 72 l.bytes = [1, 2, 3, 4, 5, 6, 7, 8]; 74 enforce(l.bytes == [8, 7, 6, 5, 4, 3, 2, 1]);
|
/thrift-3.4.0/lib/delphi/test/ |
D | TestConstants.pas | 152 function BytesToHex( const bytes : TBytes) : string; in BytesToHex() 158 function BytesToHex( const bytes : TBytes) : string; in BytesToHex() 162 for i := Low(bytes) to High(bytes) do begin 163 result := result + IntToHex(bytes[i],2);
|
/thrift-3.4.0/lib/java/src/main/java/org/apache/thrift/transport/sasl/ |
D | SaslNegotiationFrameWriter.java | 57 byte[] bytes = new byte[HEADER_BYTES + payloadLength]; in buildFrame() 58 System.arraycopy(header, headerOffset, bytes, 0, STATUS_BYTES); in buildFrame() 59 EncodingUtils.encodeBigEndian(payloadLength, bytes, STATUS_BYTES); in buildFrame() 60 System.arraycopy(payload, payloadOffset, bytes, HEADER_BYTES, payloadLength); in buildFrame() 61 return ByteBuffer.wrap(bytes); in buildFrame()
|
D | DataFrameWriter.java | 64 byte[] bytes = new byte[PAYLOAD_LENGTH_BYTES + length]; in buildFrameWithPayload() 65 EncodingUtils.encodeBigEndian(length, bytes, 0); in buildFrameWithPayload() 66 System.arraycopy(payload, offset, bytes, PAYLOAD_LENGTH_BYTES, length); in buildFrameWithPayload() 67 return ByteBuffer.wrap(bytes); in buildFrameWithPayload()
|
/thrift-3.4.0/lib/delphi/test/serializer/ |
D | TestSerializer.Tests.pas | 76 class function LengthOf( const bytes : TBytes) : Integer; overload; inline; 77 class function LengthOf( const bytes : IThriftBytes) : Integer; overload; inline; 79 class function DataPtrOf( const bytes : TBytes) : Pointer; overload; inline; 80 class function DataPtrOf( const bytes : IThriftBytes) : Pointer; overload; inline; 144 class function TTestSerializer.LengthOf( const bytes : TBytes) : Integer; in TTestSerializer.LengthOf() 146 result := Length(bytes); 150 class function TTestSerializer.LengthOf( const bytes : IThriftBytes) : Integer; in TTestSerializer.LengthOf() 152 if bytes <> nil 153 then result := bytes.Count 158 class function TTestSerializer.DataPtrOf( const bytes : TBytes) : Pointer; in TTestSerializer.DataPtrOf() [all …]
|
/thrift-3.4.0/lib/dart/lib/src/transport/ |
D | t_message_reader.dart | 20 /// [TMessageReader] extracts a [TMessage] from bytes. This is used to allow a 29 /// number of bytes to skip before reading the [TMessage]. 34 TMessage readMessage(Uint8List bytes) { 35 _transport.reset(bytes, byteOffset); 50 void reset(Uint8List bytes, [int offset = 0]) { 51 if (bytes == null) { 56 if (offset > bytes.length) { 57 throw ArgumentError("The offset exceeds the bytes length"); 60 _readIterator = bytes.iterator;
|
D | t_transport.dart | 32 /// Reads up to [length] bytes into [buffer], starting at [offset]. 33 /// Returns the number of bytes actually read. 37 /// Guarantees that all of [length] bytes are actually read off the transport. 38 /// Returns the number of bytes actually read, which must be equal to 50 "bytes, but only got $got bytes."); 57 /// Writes up to [len] bytes from the buffer. 61 /// Writes the [bytes] to the output.
|
/thrift-3.4.0/lib/netstd/Thrift/Protocol/ |
D | TCompactProtocol.cs | 73 public byte[] bytes; field 80 bytes = new byte[10], // see Int64ToVarInt() 133 … await Trans.WriteAsync(PreAllocatedVarInt.bytes, 0, PreAllocatedVarInt.count, cancellationToken); in WriteMessageBeginAsync() 242 … await Trans.WriteAsync(PreAllocatedVarInt.bytes, 0, PreAllocatedVarInt.count, cancellationToken); in WriteCollectionBeginAsync() 309 … await Trans.WriteAsync(PreAllocatedVarInt.bytes, 0, PreAllocatedVarInt.count, cancellationToken); in WriteI16Async() 316 Debug.Assert(varint.bytes.Length >= 5); in Int32ToVarInt() 322 varint.bytes[varint.count++] = (byte)n; in Int32ToVarInt() 326 varint.bytes[varint.count++] = (byte)((n & 0x7F) | 0x80); in Int32ToVarInt() 336 … await Trans.WriteAsync(PreAllocatedVarInt.bytes, 0, PreAllocatedVarInt.count, cancellationToken); in WriteI32Async() 343 Debug.Assert(varint.bytes.Length >= 10); in Int64ToVarInt() [all …]
|
/thrift-3.4.0/lib/haxe/src/org/apache/thrift/transport/ |
D | TTransport.hx | 70 * Reads up to len bytes into buffer buf, starting att offset off. 74 * @param len Maximum number of bytes to read 75 * @return The bytes count actually read 83 * Guarantees that all of len bytes are actually read off the transport. 87 * @param len Maximum number of bytes to read 88 * @return The number of bytes actually read, which must be equal to len 100 + len + " bytes, but only got " + got + " bytes."); 104 … throw new TTransportException(TTransportException.END_OF_FILE, 'Can\'t read $len bytes!'); 122 * Writes up to len bytes from the buffer. 126 * @param len The number of bytes to write
|
/thrift-3.4.0/lib/dart/lib/src/protocol/ |
D | t_json_protocol.dart | 90 /// Write the [bytes] as JSON characters, escaping as needed. 91 void _writeJsonString(Uint8List bytes) { 95 int length = bytes.length; 97 int byte = bytes[i]; 103 transport.write(bytes, i, 1); 108 transport.write(bytes, i, 1); 155 void _writeJsonBase64(Uint8List bytes) { 159 String base64text = base64.encode(bytes); 301 var bytes = s != null ? utf8Codec.encode(s) : Uint8List.fromList([]); 302 _writeJsonString(bytes); [all …]
|
/thrift-3.4.0/lib/java/src/test/java/org/apache/thrift/partial/ |
D | ThriftSerDe.java | 50 public <T extends TBase> T deserializeBinary(byte[] bytes, Class<T> clazz) throws TException { in deserializeBinary() argument 52 binaryDeserializer.deserialize(instance, bytes); in deserializeBinary() 56 public <T extends TBase> T deserializeCompact(byte[] bytes, Class<T> clazz) throws TException { in deserializeCompact() argument 58 compactDeserializer.deserialize(instance, bytes); in deserializeCompact()
|
/thrift-3.4.0/lib/go/thrift/ |
D | memory_buffer.go | 29 *bytes.Buffer 52 return &TMemoryBuffer{Buffer: &bytes.Buffer{}, size: 0} 57 return &TMemoryBuffer{Buffer: bytes.NewBuffer(buf), size: size}
|
/thrift-3.4.0/lib/d/src/thrift/transport/ |
D | range.d | 73 auto bytes = data.length; in read() local 77 buf[0 .. bytes] = data[]; in read() 78 data_ = data_[bytes .. $]; in read() 83 return bytes; in read()
|
/thrift-3.4.0/lib/javame/src/org/apache/thrift/transport/ |
D | TMemoryBuffer.java | 77 byte[] bytes = arr_.toByteArray(); in inspect() 78 for (int i = 0; i < bytes.length; i++) { in inspect() 79 buf += (pos_ == i ? "==>" : "") + Integer.toHexString(bytes[i] & 0xff) + " "; in inspect()
|
/thrift-3.4.0/lib/dart/test/transport/ |
D | t_framed_transport_test.dart | 57 // registers for readable bytes 63 // write header bytes 67 // you shouldn't be able to get any bytes from the read, 74 // you shouldn't be able to get any bytes from the read, 99 // registers for readable bytes 105 // write first part of header bytes 108 // you shouldn't be able to get any bytes from the read 111 // write second part of header bytes 114 // you shouldn't be able to get any bytes from the read again 121 // you shouldn't be able to get any bytes from the read,
|
/thrift-3.4.0/lib/java/src/test/java/org/apache/thrift/ |
D | TestTBaseHelper.java | 193 byte[] bytes = new byte[] {0, 1, 2, 3, 4, 5}; in testCopyBinaryWithByteBuffer() 194 ByteBuffer b = ByteBuffer.wrap(bytes); in testCopyBinaryWithByteBuffer() 200 b.put(bytes); in testCopyBinaryWithByteBuffer() 210 assertEquals(ByteBuffer.wrap(bytes, 1, 5), bCopy); in testCopyBinaryWithByteBuffer() 220 byte[] bytes = new byte[] {0, 1, 2, 3, 4, 5}; in testCopyBinaryWithByteArray() 221 byte[] copy = TBaseHelper.copyBinary(bytes); in testCopyBinaryWithByteArray() 222 assertEquals(ByteBuffer.wrap(bytes), ByteBuffer.wrap(copy)); in testCopyBinaryWithByteArray() 223 assertNotSame(bytes, copy); in testCopyBinaryWithByteArray()
|
/thrift-3.4.0/lib/c_glib/test/ |
D | testframedtransport.c | 273 int bytes = 0; in thrift_server() local 292 bytes = thrift_framed_transport_read (client, buf, 10, NULL); in thrift_server() 293 g_assert (bytes == 10); /* make sure we've read 10 bytes */ in thrift_server() 296 bytes = thrift_framed_transport_read (client, buf, 6, NULL); in thrift_server() 297 bytes = thrift_framed_transport_read (client, buf, 5, NULL); in thrift_server() 298 bytes = thrift_framed_transport_read (client, buf, 1, NULL); in thrift_server() 300 bytes = thrift_framed_transport_read (client, buf, 12, NULL); in thrift_server()
|
D | testthriftbufferedreadcheck.c | 173 int bytes = 0; in thrift_server() local 195 bytes = thrift_buffered_transport_read (client, buf, 3, NULL); in thrift_server() 196 g_assert (bytes == 3); /* make sure we've read 10 bytes */ in thrift_server() 199 bytes = thrift_buffered_transport_read (client, buf, 4, NULL); in thrift_server() 200 g_assert (bytes == -1); in thrift_server()
|
D | testthriftframedreadcheck.c | 170 int bytes = 0; in thrift_server() local 195 bytes = thrift_framed_transport_read (client, buf, 2, NULL); in thrift_server() 196 g_assert (bytes == 2); /* make sure we've read 2 bytes */ in thrift_server() 199 bytes = thrift_framed_transport_read (client, buf, 3, NULL); in thrift_server() 200 g_assert (bytes == -1); in thrift_server()
|