* Copyright (c) 2010-2011. Axon Framework
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
objectto the given
outputStream. This method does not close the
outputStreamafter writing the
objectThe object to serialize
outputStreamThe outputStream to write the serialized data to
java.io.IOExceptionwhen an error occurs while writing to the stream
inputStreamis not closed after reading. The resulting object instance is cast to the expected type.
Implementations are encouraged to only read the data needed for deserialization of the first encountered instance.
bytesare not consumed from the array or modified in any way. The resulting object instance is cast to the expected type.
bytesthe bytes providing the serialized data
java.lang.ClassCastExceptionif the first object in the stream is not an instance of <T>.