본문 바로가기

Background knowledge

[Common] Marshal, Unmarshal, Serialization, Stream

#Conecept


* Summary : This process of serializing an object is also called marshalling an object.[2] The opposite operation, extracting a data structure from a series of bytes, is deserialization (which is also called unmarshalling).




ex) byte -> java primitive type (unmarshal)


    java primitive type -> byte (marshal)


 


#1.Marshal 


 - Object -> XML (OMX)


 - marshaling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission, and it is typically used when data must be moved between different parts of a computer program or from one program to another. Marshalling is similar to serialization and is used to communicate to remote objects with an object, in this case a serialized object. It simplifies complex communication, using custom/complex objects to communicate instead of primitives. The opposite, or reverse, of marshalling is called unmarshalling (or demarshalling, similar to deserialization)


#2.Unmarshal 


 - XML -> Object (XUO)


#3.Serialize 

  

 - an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object


 - In computer science, in the context of data storage, serialization is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer, or transmitted across a network connection link) and reconstructed later in the same or another computer environment


 ex) java primitive type -> file, byte... (for transfer)


 Java 객체 직렬화는 JDK1.1 때부터 제공된 엄청난 기능으로, Java 인스턴스를 디스크에 저장하거나 네트워크로 전송하기 위해 바이트 배열로 전환하고, 또 역으로 그렇게 저장 / 전송된 바이트 배열을 다시 Java 인스턴스로 전환하는 기술이다.


#4.Stream


- An I/O Stream represents an input source or an output destination. A stream can represent many different kinds of sources and destinations, including disk files, devices, other programs, and memory arrays.


 Streams support many different kinds of data, including simple bytes, primitive data types, localized characters, and objects. Some streams simply pass on data; others manipulate and transform the data in useful ways.


 No matter how they work internally, all streams present the same simple model to programs that use them: A stream is a sequence of data. A program uses an input stream to read data from a source, one item at a time:


 Refrerence : https://docs.oracle.com/javase/tutorial/essential/io/streams.html