/** @return */
  public boolean startBinaryMessage() throws IOException {
    if (!_is.readFrameHeader()) {
      return false;
    }

    if (_is.getOpcode() != OP_BINARY) {
      throw new IllegalStateException(
          L.l("expected binary at '{0}' (in {1})", _is.getOpcode(), this));
    }
    return true;
  }
  @Override
  public int available() {
    long length = _is.length();

    if (length > 0) {
      return (int) Math.min(Integer.MAX_VALUE, length);
    } else if (_is.isFinal()) {
      return -1;
    } else {
      return 1;
    }
  }
 @Override
 public int read(byte[] buffer, int offset, int length) throws IOException {
   return _is.readBinary(buffer, offset, length);
 }
 @Override
 public int read() throws IOException {
   return _is.readBinary();
 }
 public long getLength() {
   return _is.length();
 }
 @Override
 public void close() throws IOException {
   _is.skipToMessageEnd();
 }
 public long skip(long length) throws IOException {
   return _is.skipBinary(length);
 }