Thanks for the great library!
Currently the implementation expects to always read to the end of the stream.
|
// end check has next byte in stream. |
|
func (sop *SerializedObjectParser) end() bool { |
|
if sop.rd.Buffered() == 0 { |
|
_, eof := sop.rd.Peek(1) |
|
|
|
return eof != nil |
|
} |
|
|
|
return false |
|
} |
I have a case where the stream contains other stuff in addition to the serialised java object. And I don't have a size of the java object to be able to r = io.LimitReader(r,size) before attempting to parse.
I.e. I want to be able to do something like:
sop := jserial.NewSerializedObjectParser(r)
minimal, err := sop.ParseSingleSerializedObjectMinimal()
if err != nil {
return err
}
r.Read(buf)
where buf would be populated with content right after the first serialised object
minimal would then be the single deserialised object, instead of a slice/jsonArray
Thanks for the great library!
Currently the implementation expects to always read to the end of the stream.
jserial/deserialize.go
Lines 356 to 365 in afb2f73
I have a case where the stream contains other stuff in addition to the serialised java object. And I don't have a
sizeof the java object to be able tor = io.LimitReader(r,size)before attempting to parse.I.e. I want to be able to do something like:
where
bufwould be populated with content right after the first serialised objectminimalwould then be the single deserialised object, instead of a slice/jsonArray