0
가능한 중복 :
What is the difference between Serialization and Marshalling?마샬링 및 직렬화
자바에 정렬 화되어 무엇을 마샬링 및 직렬화의 차이점은 무엇입니까? 이
가능한 중복 :
What is the difference between Serialization and Marshalling?마샬링 및 직렬화
자바에 정렬 화되어 무엇을 마샬링 및 직렬화의 차이점은 무엇입니까? 이
이의 유래에 많은 훌륭한 게시물이 있지만, 여기에 간단한 대답을 원하는 경우는 다음과 같습니다
그들은 같은 것, 그리고 용어는 같은 의미로 사용됩니다. Java 세계에서 두 가지 모두 실제로 사용됩니다.
JAXB (개체를 XML로 변환)에는 마샬링이라는 용어가 사용됩니다. 예 :
JAXBContext jc = JAXBContext.newInstance("com.acme.foo");
Unmarshaller u = jc.createUnmarshaller();
FooObject obj = (FooObject)u.unmarshal(new File("foo.xml"));
Marshaller m = jc.createMarshaller();
Java 객체를 바이트로 변환하는 데 직렬화라는 용어가 사용됩니다. 예 :
import java.io.Serializable;
public class Person implements Serializable
{
private String name;
public Person(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
}
그래서 대부분의 의미입니다.