public static Buffer readFrame(java.io.InputStream input) throws IOException { int length = readRawVarint32(input); byte[] data = new byte[length]; int pos = 0; while (pos < length) { int r = input.read(data, pos, length - pos); if (r < 0) { throw new InvalidProtocolBufferException("Input stream ended before a full message frame could be read."); } pos += r; } return new Buffer(data); }
public static Buffer readFrame(java.io.InputStream input) throws IOException { int length = readRawVarint32(input); byte[] data = new byte[length]; int pos = 0; while (pos < length) { int r = input.read(data, pos, length - pos); if (r < 0) { throw new InvalidProtocolBufferException("Input stream ended before a full message frame could be read."); } pos += r; } return new Buffer(data); }
public static Buffer readFrame(java.io.InputStream input) throws IOException { int length = readRawVarint32(input); byte[] data = new byte[length]; int pos = 0; while (pos < length) { int r = input.read(data, pos, length - pos); if (r < 0) { throw new InvalidProtocolBufferException("Input stream ended before a full message frame could be read."); } pos += r; } return new Buffer(data); }