Class GapListPrimitives
java.lang.Object
org.magicwerk.brownies.collections.primitive.GapListPrimitives
- Direct Known Subclasses:
GapLists
This class implements helper for primitives.
Public access is granted through
GapLists
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
add
(CharSequence str, CharGapList list, int start, int end) Add specified number of chars from CharSequence into CharGapList.protected static int
read
(InputStream istream, ByteGapList list, int len) Read specified number of bytes from InputStream into ByteGapList.protected static int
read
(Reader reader, CharGapList list, int len) Read specified number of chars from Reader into CharGapList.protected static void
write
(OutputStream ostream, ByteGapList list, int off, int len) Write specified number of bytes from ByteGapList into OutputStream.protected static void
write
(Writer writer, CharGapList list, int off, int len) Write specified number of chars from CharGapList into Writer.
-
Constructor Details
-
GapListPrimitives
public GapListPrimitives()
-
-
Method Details
-
read
Read specified number of bytes from InputStream into ByteGapList.- Parameters:
istream
- input stream (source)list
- list (target)len
- maximum number of bytes to read- Returns:
- number of bytes read into the buffer, -1 if end of stream has been reached
- Throws:
IOException
-
write
protected static void write(OutputStream ostream, ByteGapList list, int off, int len) throws IOException Write specified number of bytes from ByteGapList into OutputStream.- Parameters:
ostream
- output stream (target)list
- list (source)off
- offset of first byte to writelen
- number of bytes to write- Throws:
IOException
-
read
Read specified number of chars from Reader into CharGapList.- Parameters:
reader
- reader (source)list
- list (target)len
- maximum number of bytes to read- Returns:
- number of bytes read into the buffer, -1 if end of stream has been reached
- Throws:
IOException
-
write
Write specified number of chars from CharGapList into Writer.- Parameters:
writer
- writer (target)list
- list (source)off
- offset of first char to writelen
- number of chars to write- Throws:
IOException
-
add
Add specified number of chars from CharSequence into CharGapList.- Parameters:
str
- CharSequence (source)list
- list (target)start
- start position of characters to add in CharSequenceend
- end position of characters to add in CharSequence
-