Package org.fressian
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.void
close()
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) void
writeCode
(int code) void
writeCount
(int count) writeDouble
(double d) writeFloat
(float f) writeFloat
(Object o) void
Write 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:
writeNull
in interfaceWriter
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceWriter
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceWriter
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceWriter
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceWriter
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfaceWriter
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfaceWriter
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceWriter
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceWriter
- Throws:
IOException
-
writeString
- Specified by:
writeString
in interfaceWriter
- Throws:
IOException
-
writeList
- Specified by:
writeList
in interfaceWriter
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceWriter
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceWriter
- Throws:
IOException
-
resetCaches
- Specified by:
resetCaches
in interfaceWriter
- Throws:
IOException
-
getPriorityCache
-
getStructCache
-
writeTag
- Specified by:
writeTag
in interfaceWriter
- Throws:
IOException
-
writeExt
- Throws:
IOException
-
writeCount
- Throws:
IOException
-
writeAs
- Specified by:
writeAs
in interfaceWriter
- Throws:
IOException
-
writeAs
- Specified by:
writeAs
in interfaceWriter
- Throws:
IOException
-
writeObject
- Specified by:
writeObject
in interfaceWriter
- Throws:
IOException
-
writeObject
- Specified by:
writeObject
in interfaceWriter
- Throws:
IOException
-
writeCode
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
beginClosedList
Description copied from interface:StreamingWriter
Begin 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:
beginClosedList
in interfaceStreamingWriter
- Returns:
- this Writer (fluent)
- Throws:
IOException
-
endList
Description copied from interface:StreamingWriter
Mark the end of a variable-lenght list, either closed or open.- Specified by:
endList
in interfaceStreamingWriter
- Returns:
- this Writer (fluent)
- Throws:
IOException
-
beginOpenList
Description copied from interface:StreamingWriter
Begin 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:
beginOpenList
in interfaceStreamingWriter
- Returns:
- this Writer (fluent)
- Throws:
IOException
-