/** * Checks whether the length of that was encoded is also available from the * stream. * * @param is InputStream * @param length int * @throws IOException * if the bytes that are given in length cannot be read from the input * stream (without blocking). */ private static void checkLength(BERInputStream is, int length) throws IOException { if (!checkValueLength) { return; } if ((length < 0) || (length > is.getAvailableBytes())) { throw new IOException("The encoded length "+ length+ " exceeds the number of bytes left in input"+ getPositionMessage(is)+ " which actually is "+is.getAvailableBytes()); } }
/** * Checks whether the length of that was encoded is also available from the * stream. * * @param is InputStream * @param length int * @throws IOException * if the bytes that are given in length cannot be read from the input * stream (without blocking). */ private static void checkLength(BERInputStream is, int length) throws IOException { if (!checkValueLength) { return; } if ((length < 0) || (length > is.getAvailableBytes())) { throw new IOException("The encoded length "+ length+ " exceeds the number of bytes left in input"+ getPositionMessage(is)+ " which actually is "+is.getAvailableBytes()); } }
/** * Checks whether the length of that was encoded is also available from the * stream. * * @param is InputStream * @param length int * @throws IOException * if the bytes that are given in length cannot be read from the input * stream (without blocking). */ private static void checkLength(BERInputStream is, int length) throws IOException { if (!checkValueLength) { return; } if ((length < 0) || (length > is.getAvailableBytes())) { throw new IOException("The encoded length "+ length+ " exceeds the number of bytes left in input"+ getPositionMessage(is)+ " which actually is "+is.getAvailableBytes()); } }