Class LengthedBody
java.lang.Object
org.netpreserve.jwarc.MessageParser
org.netpreserve.jwarc.MessageBody
org.netpreserve.jwarc.LengthedBody
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,ReadableByteChannel
A message body with a known length.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidconsume()static LengthedBodycreate(ReadableByteChannel channel, ByteBuffer buffer, long size) booleanisOpen()longposition()The current position in bytes within the content body.intread(ByteBuffer dest) longsize()The length in bytes of the content body.stream()Returns an InputStream for reading this body.Methods inherited from class org.netpreserve.jwarc.MessageBody
emptyMethods inherited from class org.netpreserve.jwarc.MessageParser
emitWarning, getErrorContext, getErrorContext
-
Method Details
-
create
-
read
- Throws:
IOException
-
consume
- Overrides:
consumein classMessageBody- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Throws:
IOException
-
size
-
position
public long position()The current position in bytes within the content body.- Specified by:
positionin classMessageBody
-
stream
Returns an InputStream for reading this body.- Overrides:
streamin classMessageBody
-