@@ -45,81 +45,81 @@ public MessagePack(MessagePack parent) {
4545 registry = new TemplateRegistry (parent .registry );
4646 }
4747
48- public byte [] pack (Object v ) throws IOException {
49- return pack (v , getTemplate (v .getClass ()));
48+ public byte [] write (Object v ) throws IOException {
49+ return write (v , getTemplate (v .getClass ()));
5050 }
5151
52- public byte [] pack (Object v , Template tmpl ) throws IOException { // TODO IOException
53- BufferPacker pk = new BufferPacker ();
54- tmpl .write (pk , v );
55- return pk .toByteArray ();
52+ public byte [] write (Object v , Template tmpl ) throws IOException { // TODO IOException
53+ BufferPacker pk = new BufferPacker ();
54+ tmpl .write (pk , v );
55+ return pk .toByteArray ();
5656 }
5757
58- public void pack (OutputStream out , Object v ) throws IOException {
59- pack (out , v , getTemplate (v .getClass ()));
58+ public void write (OutputStream out , Object v ) throws IOException {
59+ write (out , v , getTemplate (v .getClass ()));
6060 }
6161
62- public void pack (OutputStream out , Object v , Template tmpl ) throws IOException {
62+ public void write (OutputStream out , Object v , Template tmpl ) throws IOException {
6363 StreamPacker pk = new StreamPacker (out );
6464 tmpl .write (pk , v );
6565 }
6666
67- public byte [] pack (Value v ) throws IOException { // TODO IOException
67+ public byte [] write (Value v ) throws IOException { // TODO IOException
6868 // FIXME ValueTemplate should do this
6969 BufferPacker pk = new BufferPacker ();
7070 pk .write (v );
7171 return pk .toByteArray ();
7272 }
7373
74- public <T > T unpack (InputStream in , T v ) throws IOException {
74+ public <T > T read (InputStream in , T v ) throws IOException {
7575 // TODO
7676 Template tmpl = getTemplate (v .getClass ());
7777 return (T )tmpl .read (new StreamUnpacker (in ), v );
7878 }
7979
80- public <T > T unpack (InputStream in , Class <T > c ) throws IOException {
80+ public <T > T read (InputStream in , Class <T > c ) throws IOException {
8181 // TODO
8282 Template tmpl = getTemplate (c );
8383 return (T )tmpl .read (new StreamUnpacker (in ), null );
8484 }
8585
86- public Value unpack (byte [] b ) throws IOException { // TODO IOException
87- return unpack (b , 0 , b .length );
86+ public Value read (byte [] b ) throws IOException { // TODO IOException
87+ return read (b , 0 , b .length );
8888 }
8989
90- public Value unpack (byte [] b , int off , int len ) throws IOException { // TODO IOException
90+ public Value read (byte [] b , int off , int len ) throws IOException { // TODO IOException
9191 return new BufferUnpacker ().wrap (b , off , len ).readValue ();
9292 }
9393
94- public Value unpack (ByteBuffer buf ) throws IOException { // TODO IOException
94+ public Value read (ByteBuffer buf ) throws IOException { // TODO IOException
9595 return new BufferUnpacker ().wrap (buf ).readValue ();
9696 }
9797
98- public <T > T unpack (byte [] b , T v ) throws IOException { // TODO IOException
98+ public <T > T read (byte [] b , T v ) throws IOException { // TODO IOException
9999 // TODO
100100 Template tmpl = getTemplate (v .getClass ());
101101 BufferUnpacker u = new BufferUnpacker ();
102102 u .wrap (b );
103103 return (T )tmpl .read (u , v );
104104 }
105105
106- public <T > T unpack (byte [] b , Class <T > c ) throws IOException { // TODO IOException
106+ public <T > T read (byte [] b , Class <T > c ) throws IOException { // TODO IOException
107107 // TODO
108108 Template tmpl = getTemplate (c );
109109 BufferUnpacker u = new BufferUnpacker ();
110110 u .wrap (b );
111111 return (T )tmpl .read (u , null );
112112 }
113113
114- public <T > T unpack (ByteBuffer b , T v ) throws IOException { // TODO IOException
114+ public <T > T read (ByteBuffer b , T v ) throws IOException { // TODO IOException
115115 // TODO
116116 Template tmpl = getTemplate (v .getClass ());
117117 BufferUnpacker u = new BufferUnpacker ();
118118 u .wrap (b );
119119 return (T )tmpl .read (u , v );
120120 }
121121
122- public <T > T unpack (ByteBuffer b , Class <T > c ) { // TODO IOException
122+ public <T > T read (ByteBuffer b , Class <T > c ) { // TODO IOException
123123 // TODO
124124 Template tmpl = getTemplate (c );
125125 BufferUnpacker u = new BufferUnpacker ();
0 commit comments