KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > rmi > readers > BinaryReader


1 package com.daffodilwoods.rmi.readers;
2
3 import java.io.ObjectInput JavaDoc;
4 import java.io.IOException JavaDoc;
5
6 public class BinaryReader implements _ObjectReader {
7   public static _ObjectReader objectReader = new BinaryReader();
8   private BinaryReader() {
9   }
10   public Object JavaDoc read(ObjectInput JavaDoc in) throws IOException JavaDoc,ClassNotFoundException JavaDoc {
11     int bin_length = (int) in.readShort();
12     byte[] bin_bytes = new byte[bin_length];
13     in.read(bin_bytes);
14     return bin_bytes;
15   }
16
17 }
18
Popular Tags