IoUtils

eu.ostrzyciel.jelly.core.IoUtils
object IoUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
IoUtils.type

Members list

Value members

Concrete methods

def autodetectDelimiting(in: InputStream): (Boolean, InputStream)

Autodetects whether the input stream is a non-delimited Jelly file or a delimited Jelly file.

Autodetects whether the input stream is a non-delimited Jelly file or a delimited Jelly file.

To do this, the first three bytes in the stream are peeked. These bytes are then put back into the stream, and the stream is returned, so the parser won't notice the peeking.

Value parameters

in

the input stream

Attributes

Returns

(isDelimited, newInputStream) where isDelimited is true if the stream is a delimited Jelly file

def writeFrameAsDelimited(nonDelimitedFrame: Array[Byte], output: OutputStream): Unit

Utility method to transform a non-delimited Jelly frame (as a byte array) into a delimited one, writing it to a byte stream.

Utility method to transform a non-delimited Jelly frame (as a byte array) into a delimited one, writing it to a byte stream.

This is useful if you for example store non-delimited frames in a database, but want to write them to a stream.

Value parameters

nonDelimitedFrame

EXACTLY one non-delimited Jelly frame

output

the output stream to write the frame to

Attributes