Package com.azure.core.exception
Class UnexpectedLengthException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalStateException
-
- com.azure.core.exception.UnexpectedLengthException
-
- All Implemented Interfaces:
Serializable
public final class UnexpectedLengthException extends IllegalStateException
This exception class represents an error when the specified input length doesn't match the data length.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UnexpectedLengthException(String message, long bytesRead, long bytesExpected)
Constructor of the UnexpectedLengthException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBytesExpected()
Gets the number of bytes that were expected to be read from the input.long
getBytesRead()
Gets the number of bytes read from the input.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
UnexpectedLengthException
public UnexpectedLengthException(String message, long bytesRead, long bytesExpected)
Constructor of the UnexpectedLengthException.- Parameters:
message
- The message for the exception.bytesRead
- The number of bytes read from resource.bytesExpected
- The number of bytes expected from the receiver.
-
-
Method Detail
-
getBytesRead
public long getBytesRead()
Gets the number of bytes read from the input.- Returns:
- the number of bytes read from the input
-
getBytesExpected
public long getBytesExpected()
Gets the number of bytes that were expected to be read from the input.- Returns:
- the number of bytes that were expected to be read from the input
-
-