public static byte[] readFixedBytes(InputStream input, int length)
            throws SerializationException {
        try {
            if (length < 0) {
                throw new SerializationException("Negative length: " + length);
            }

            byte[] data = new byte[length];
            int count = input.read(data);
            if (count < length) {
                throw new SerializationException("Premature end of input, expected " + length +
                                                 " bytes, only read " + count);
            }
            return data;
        } catch (IOException e) {
            throw new SerializationException(e);
        }
    }
Read a fixed number of bytes from the input stream.
@param length the number of bytes to read.
@throws SerializationException if EOF is encountered.
common/src/main/java/org/conscrypt/ct/Serialization.java