Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream out = null;
- try {
- out = new ObjectOutputStream(baos);
- } catch (IOException e) {
- e.printStackTrace();
- }
- for (Car element : carList) {
- try {
- out.writeObject(element);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- byte[] xaValue = baos.toByteArray();
- deserializacja
- byte[] bytes = theInteraction.getValue(i);
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- ObjectInputStream in = new ObjectInputStream(bais);
- while (in.available() > 0) {
- Car element = (Car)in.readObject();
- this.value.add(element);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement