Package org.jruby.runtime.load
Class LoadServiceResourceInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.jruby.runtime.load.LoadServiceResourceInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final intFields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos -
Constructor Summary
ConstructorsConstructorDescriptionLoadServiceResourceInputStream(byte[] bytes) Construct a LoadServiceResourceInputStream from the given bytes.Construct a new LoadServiceInputStream by reading all bytes from the specified stream. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbufferEntireStream(InputStream stream) byte[]getBytes()Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferToMethods inherited from class java.io.InputStream
nullInputStream, read, readNBytes, skipNBytes
-
Field Details
-
NULL_BYTE_ARRAY
private static final byte[] NULL_BYTE_ARRAY -
READ_CHUNK_SIZE
private static final int READ_CHUNK_SIZE- See Also:
-
-
Constructor Details
-
LoadServiceResourceInputStream
public LoadServiceResourceInputStream(byte[] bytes) Construct a LoadServiceResourceInputStream from the given bytes.- Parameters:
bytes- the bytes to wrap in this stream
-
LoadServiceResourceInputStream
Construct a new LoadServiceInputStream by reading all bytes from the specified stream. You are responsible for the lifecycle of the given stream after this constructor has been called (i.e. it will not be closed for you).- Parameters:
stream- the stream from which to read bytes- Throws:
IOException- if the reading causes an IOException
-
-
Method Details
-
getBytes
public byte[] getBytes() -
bufferEntireStream
- Throws:
IOException
-