/** * Writes a list as a typed bytes sequence. * * @param list * the list to be written * @throws IOException */ public void writeList(List list) throws IOException { writeListHeader(); for (Object obj : list) { write(obj); } writeListFooter(); }
/** * Writes a vector as a typed bytes sequence. * * @param vector * the vector to be written * @throws IOException */ public void writeVector(ArrayList vector) throws IOException { writeVectorHeader(vector.size()); for (Object obj : vector) { write(obj); } }
/** * Writes a map as a typed bytes sequence. * * @param map * the map to be written * @throws IOException */ @SuppressWarnings("unchecked") public void writeMap(Map map) throws IOException { writeMapHeader(map.size()); Set<Entry> entries = map.entrySet(); for (Entry entry : entries) { write(entry.getKey()); write(entry.getValue()); } }
/** Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); set(bytes, 0, bytes.length); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Writes a list as a typed bytes sequence. * * @param list * the list to be written * @throws IOException */ public void writeList(List list) throws IOException { writeListHeader(); for (Object obj : list) { write(obj); } writeListFooter(); }
/** * Writes a vector as a typed bytes sequence. * * @param vector * the vector to be written * @throws IOException */ public void writeVector(ArrayList vector) throws IOException { writeVectorHeader(vector.size()); for (Object obj : vector) { write(obj); } }
/** * Writes a map as a typed bytes sequence. * * @param map * the map to be written * @throws IOException */ @SuppressWarnings("unchecked") public void writeMap(Map map) throws IOException { writeMapHeader(map.size()); Set<Entry> entries = map.entrySet(); for (Entry entry : entries) { write(entry.getKey()); write(entry.getValue()); } }
/** Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); set(bytes, 0, bytes.length); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Writes a list as a typed bytes sequence. * * @param list * the list to be written * @throws IOException */ public void writeList(List list) throws IOException { writeListHeader(); for (Object obj : list) { write(obj); } writeListFooter(); }
/** * Writes a vector as a typed bytes sequence. * * @param vector * the vector to be written * @throws IOException */ public void writeVector(ArrayList vector) throws IOException { writeVectorHeader(vector.size()); for (Object obj : vector) { write(obj); } }
/** * Writes a map as a typed bytes sequence. * * @param map * the map to be written * @throws IOException */ @SuppressWarnings("unchecked") public void writeMap(Map map) throws IOException { writeMapHeader(map.size()); Set<Entry> entries = map.entrySet(); for (Entry entry : entries) { write(entry.getKey()); write(entry.getValue()); } }
/** Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); set(bytes, 0, bytes.length); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Writes a list as a typed bytes sequence. * * @param list * the list to be written * @throws IOException */ public void writeList(List list) throws IOException { writeListHeader(); for (Object obj : list) { write(obj); } writeListFooter(); }
/** * Writes a vector as a typed bytes sequence. * * @param vector * the vector to be written * @throws IOException */ public void writeVector(ArrayList vector) throws IOException { writeVectorHeader(vector.size()); for (Object obj : vector) { write(obj); } }
/** * Writes a map as a typed bytes sequence. * * @param map * the map to be written * @throws IOException */ @SuppressWarnings("unchecked") public void writeMap(Map map) throws IOException { writeMapHeader(map.size()); Set<Entry> entries = map.entrySet(); for (Entry entry : entries) { write(entry.getKey()); write(entry.getValue()); } }
/** Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); set(bytes, 0, bytes.length); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Writes a list as a typed bytes sequence. * * @param list * the list to be written * @throws IOException */ public void writeList(List list) throws IOException { writeListHeader(); for (Object obj : list) { write(obj); } writeListFooter(); }
/** * Writes a vector as a typed bytes sequence. * * @param vector * the vector to be written * @throws IOException */ public void writeVector(ArrayList vector) throws IOException { writeVectorHeader(vector.size()); for (Object obj : vector) { write(obj); } }
/** * Writes a map as a typed bytes sequence. * * @param map * the map to be written * @throws IOException */ @SuppressWarnings("unchecked") public void writeMap(Map map) throws IOException { writeMapHeader(map.size()); Set<Entry> entries = map.entrySet(); for (Entry entry : entries) { write(entry.getKey()); write(entry.getValue()); } }
/** Set the typed bytes from a given Java object. */ public void setValue(Object obj) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TypedBytesOutput tbo = TypedBytesOutput.get(new DataOutputStream(baos)); tbo.write(obj); byte[] bytes = baos.toByteArray(); set(bytes, 0, bytes.length); } catch (IOException e) { throw new RuntimeException(e); } }