class CeosFileReader {

    public String readAn(final int n) throws IOException, IllegalCeosFormatException {
        final long streamPosition = stream.getStreamPosition();
        final byte[] bytes = new byte[n];
        final int bytesRead;
        try {
            bytesRead = stream.read(bytes);
        } catch (IOException e) {
            final String message = String.format(CeosFileReader.EM_READING_X_TYPE, "An");
            throw new IllegalCeosFormatException(message, streamPosition, e);
        }
        if (bytesRead != n) {
            final String message = String.format(CeosFileReader.EM_EXPECTED_X_FOUND_Y_BYTES, n, bytesRead);
            throw new IllegalCeosFormatException(message, streamPosition);
        }
        return new String(bytes);
    }

    public  CeosFileReader(final ImageInputStream stream);

}