Class ByteArrayRandomAccessData
- java.lang.Object
-
- fish.payara.micro.boot.loader.data.ByteArrayRandomAccessData
-
- All Implemented Interfaces:
RandomAccessData
public class ByteArrayRandomAccessData extends Object implements RandomAccessData
RandomAccessDataimplementation backed by a byte array.- Author:
- Phillip Webb
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface fish.payara.micro.boot.loader.data.RandomAccessData
RandomAccessData.ResourceAccess
-
-
Constructor Summary
Constructors Constructor Description ByteArrayRandomAccessData(byte[] bytes)ByteArrayRandomAccessData(byte[] bytes, long offset, long length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetInputStream(RandomAccessData.ResourceAccess access)Returns anInputStreamthat can be used to read the underlying data.longgetSize()Returns the size of the data.RandomAccessDatagetSubsection(long offset, long length)Returns a newRandomAccessDatafor a specific subsection of this data.
-
-
-
Method Detail
-
getInputStream
public InputStream getInputStream(RandomAccessData.ResourceAccess access)
Description copied from interface:RandomAccessDataReturns anInputStreamthat can be used to read the underlying data. The caller is responsible close the underlying stream.- Specified by:
getInputStreamin interfaceRandomAccessData- Parameters:
access- hint indicating how the underlying data should be accessed- Returns:
- a new input stream that can be used to read the underlying data.
-
getSubsection
public RandomAccessData getSubsection(long offset, long length)
Description copied from interface:RandomAccessDataReturns a newRandomAccessDatafor a specific subsection of this data.- Specified by:
getSubsectionin interfaceRandomAccessData- Parameters:
offset- the offset of the subsectionlength- the length of the subsection- Returns:
- the subsection data
-
getSize
public long getSize()
Description copied from interface:RandomAccessDataReturns the size of the data.- Specified by:
getSizein interfaceRandomAccessData- Returns:
- the size
-
-