Package org.apache.groovy.json.internal
Class IO
java.lang.Object
org.apache.groovy.json.internal.IO
Reader and writer helpers used by the JSON parser internals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intCopies all characters from a reader to a writer.static longCopies all characters from a reader to a writer using the default buffer size.static longCopies all characters from a reader to a writer using the supplied buffer.static CharBufReads all characters from a reader into a recyclable buffer and closes the reader.
-
Constructor Details
-
IO
public IO()
-
-
Method Details
-
read
Reads all characters from a reader into a recyclable buffer and closes the reader.- Parameters:
input- reader supplying characterscharBuf- existing buffer to reuse, ornullto allocate onebufSize- initial buffer size when a new buffer is allocated- Returns:
- buffer containing the reader contents
-
copy
Copies all characters from a reader to a writer.- Parameters:
input- reader supplying charactersoutput- writer receiving characters- Returns:
- number of copied characters, or
-1when the count exceedsInteger.MAX_VALUE
-
copyLarge
Copies all characters from a reader to a writer using the default buffer size.- Parameters:
reader- reader supplying characterswriter- writer receiving characters- Returns:
- number of copied characters
-
copyLarge
Copies all characters from a reader to a writer using the supplied buffer.- Parameters:
reader- reader supplying characterswriter- writer receiving charactersbuffer- temporary buffer to reuse during copying- Returns:
- number of copied characters
-