public TList readListBegin() throws TException { TList list = new TList(readByte(), readI32()); checkContainerReadLength(list.size); return list; }
public TList readListBegin() throws TException { TList list = new TList(readByte(), readI32()); checkContainerReadLength(list.size); return list; }
public TSet readSetBegin() throws TException { TSet set = new TSet(readByte(), readI32()); checkContainerReadLength(set.size); return set; }
/** * Reading methods. */ public TMessage readMessageBegin() throws TException { int size = readI32(); if (size < 0) { int version = size & VERSION_MASK; if (version != VERSION_1) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Bad version in readMessageBegin"); } return new TMessage(readString(), (byte)(size & 0x000000ff), readI32()); } else { if (strictRead_) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Missing version in readMessageBegin, old client?"); } return new TMessage(readStringBody(size), readByte(), readI32()); } }
public TSet readSetBegin() throws TException { TSet set = new TSet(readByte(), readI32()); checkContainerReadLength(set.size); return set; }
/** * Reading methods. */ public TMessage readMessageBegin() throws TException { int size = readI32(); if (size < 0) { int version = size & VERSION_MASK; if (version != VERSION_1) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Bad version in readMessageBegin"); } return new TMessage(readString(), (byte)(size & 0x000000ff), readI32()); } else { if (strictRead_) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Missing version in readMessageBegin, old client?"); } return new TMessage(readStringBody(size), readByte(), readI32()); } }
public ByteBuffer readBinary() throws TException { int size = readI32(); if (stringLengthLimit_ > 0 && size > stringLengthLimit_) { throw new TProtocolException(TProtocolException.SIZE_LIMIT, "Binary field exceeded string size limit"); } if (trans_.getBytesRemainingInBuffer() >= size) { ByteBuffer bb = ByteBuffer.wrap(trans_.getBuffer(), trans_.getBufferPosition(), size); trans_.consumeBuffer(size); return bb; } byte[] buf = new byte[size]; trans_.readAll(buf, 0, size); return ByteBuffer.wrap(buf); }
public ByteBuffer readBinary() throws TException { int size = readI32(); if (stringLengthLimit_ > 0 && size > stringLengthLimit_) { throw new TProtocolException(TProtocolException.SIZE_LIMIT, "Binary field exceeded string size limit"); } if (trans_.getBytesRemainingInBuffer() >= size) { ByteBuffer bb = ByteBuffer.wrap(trans_.getBuffer(), trans_.getBufferPosition(), size); trans_.consumeBuffer(size); return bb; } byte[] buf = new byte[size]; trans_.readAll(buf, 0, size); return ByteBuffer.wrap(buf); }
public TMap readMapBegin() throws TException { TMap map = new TMap(readByte(), readByte(), readI32()); checkContainerReadLength(map.size); return map; }
public TMap readMapBegin() throws TException { TMap map = new TMap(readByte(), readByte(), readI32()); checkContainerReadLength(map.size); return map; }
public String readString() throws TException { int size = readI32(); checkStringReadLength(size); if (stringLengthLimit_ > 0 && size > stringLengthLimit_) { throw new TProtocolException(TProtocolException.SIZE_LIMIT, "String field exceeded string size limit"); } if (trans_.getBytesRemainingInBuffer() >= size) { try { String s = new String(trans_.getBuffer(), trans_.getBufferPosition(), size, "UTF-8"); trans_.consumeBuffer(size); return s; } catch (UnsupportedEncodingException e) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } } return readStringBody(size); }
public String readString() throws TException { int size = readI32(); checkStringReadLength(size); if (stringLengthLimit_ > 0 && size > stringLengthLimit_) { throw new TProtocolException(TProtocolException.SIZE_LIMIT, "String field exceeded string size limit"); } if (trans_.getBytesRemainingInBuffer() >= size) { try { String s = new String(trans_.getBuffer(), trans_.getBufferPosition(), size, "UTF-8"); trans_.consumeBuffer(size); return s; } catch (UnsupportedEncodingException e) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } } return readStringBody(size); }