Class FressianWriter
java.lang.Object
org.fressian.FressianWriter
- All Implemented Interfaces:
Closeable, AutoCloseable, StreamingWriter, Writer
-
Constructor Summary
ConstructorsConstructorDescriptionFressianWriter(OutputStream out, ILookup<Class, Map<String, WriteHandler>> userHandlers) Create a writer that combines userHandlers with the normal type handlers built into Fressian. -
Method Summary
Modifier and TypeMethodDescriptionBegin a variable-length closed list.Begin a variable-length open list.voidclose()endList()Mark the end of a variable-lenght list, either closed or open.writeBoolean(boolean b) writeBytes(byte[] b) writeBytes(byte[] b, int offset, int length) voidwriteCode(int code) voidwriteCount(int count) writeDouble(double d) writeFloat(float f) writeFloat(Object o) voidWrite a footer for some existing fressianed data (the readable portion of bb.) For advanced use when building a larger fressianed stream from existing content.writeInt(long i) writeObject(Object o, boolean cache)
-
Constructor Details
-
FressianWriter
-
FressianWriter
Create a writer that combines userHandlers with the normal type handlers built into Fressian.
-
-
Method Details
-
writeNull
- Specified by:
writeNullin interfaceWriter- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceWriter- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceWriter- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceWriter- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceWriter- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceWriter- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceWriter- Throws:
IOException
-
writeString
- Specified by:
writeStringin interfaceWriter- Throws:
IOException
-
writeList
- Specified by:
writeListin interfaceWriter- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceWriter- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceWriter- Throws:
IOException
-
resetCaches
- Specified by:
resetCachesin interfaceWriter- Throws:
IOException
-
getPriorityCache
-
getStructCache
-
writeTag
- Specified by:
writeTagin interfaceWriter- Throws:
IOException
-
writeExt
- Throws:
IOException
-
writeCount
- Throws:
IOException
-
writeAs
- Specified by:
writeAsin interfaceWriter- Throws:
IOException
-
writeAs
- Specified by:
writeAsin interfaceWriter- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfaceWriter- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfaceWriter- Throws:
IOException
-
writeCode
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
beginClosedList
Description copied from interface:StreamingWriterBegin a variable-length closed list. This allows you (the writer) to write very large things, or things of unknown size, without having to place them in a collection first. However, you must remember to call endList when you are done, or the resulting stream will not be readable.- Specified by:
beginClosedListin interfaceStreamingWriter- Returns:
- this Writer (fluent)
- Throws:
IOException
-
endList
Description copied from interface:StreamingWriterMark the end of a variable-lenght list, either closed or open.- Specified by:
endListin interfaceStreamingWriter- Returns:
- this Writer (fluent)
- Throws:
IOException
-
beginOpenList
Description copied from interface:StreamingWriterBegin a variable-length open list. An open list can be terminated either by a call to endList, *or* by an end of stream. Using an open is much more subtle than either a fixed or closed variable list. Avoid it if either other choice can work.- Specified by:
beginOpenListin interfaceStreamingWriter- Returns:
- this Writer (fluent)
- Throws:
IOException
-