Code example for ByteArrayInputStream

Methods: read

0
    transport_.close();
  } 
 
  public int read(byte[] buf, int off, int len) throws TTransportException {
    if (readBuffer_ != null) {
      int got = readBuffer_.read(buf, off, len);
      if (got > 0) {
        return got;
      } 
    } 
 
    // Read another frame of data 
    readFrame(); 
 
    return readBuffer_.read(buf, off, len);
  } 
 
  private void readFrame() throws TTransportException { 
    byte[] i32rd = new byte[4];
    transport_.readAll(i32rd, 0, 4);
    int size =