Package org.exbin.xbup.core.ubnumber
Interface UBStreamable
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
UBBoolean
,UBEInteger
,UBENatural
,UBInteger
,UBNatural
,UBRatio
,XBAttribute
,XBEditableAttribute
@ParametersAreNonnullByDefault public interface UBStreamable extends java.io.Serializable
This interface provides methods for object conversion from and to stream in XBUP protocol stack in its native form.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
fromStreamUB(java.io.InputStream stream)
Reads value in UB Encoding from standard byte stream.int
getSizeUB()
Returns size of data which would be saved in byte stream.int
toStreamUB(java.io.OutputStream stream)
Writes current value in UB Encoding to standard byte stream.
-
-
-
Method Detail
-
toStreamUB
int toStreamUB(java.io.OutputStream stream) throws java.io.IOException
Writes current value in UB Encoding to standard byte stream.- Parameters:
stream
- Stream to write to- Returns:
- count of bytes written to stream
- Throws:
java.io.IOException
- if stream throws it
-
fromStreamUB
int fromStreamUB(java.io.InputStream stream) throws java.io.IOException
Reads value in UB Encoding from standard byte stream.- Parameters:
stream
- Stream to read from- Returns:
- count of bytes read from stream
- Throws:
java.io.IOException
- if stream throws it
-
getSizeUB
int getSizeUB()
Returns size of data which would be saved in byte stream.- Returns:
- count of bytes which would be saved
-
-