Examples of sliceAsBytes()


Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

    {
        try {
            RecordLocation loc = (RecordLocation)marks.get(id);
            Packet packet = journal.read(loc);
            ObjectInputStream ois = new ObjectInputStream(
                    new ByteArrayInputStream(packet.sliceAsBytes()));
            ois.readByte();
            ois.readUTF();
            ois.skipBytes(UUID_LENGTH);
            Object obj = ois.readObject();
            return obj;
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

        try {
            synchronized (markLock) {
                // While we have records in the journal.
                while ((pos = journal.getNextRecordLocation(pos)) != null) {
                    Packet packet = journal.read(pos);
                    byte[] buffer = packet.sliceAsBytes();
                    if (buffer[0] == DELETE_BYTE) {
                        UUID id = new UUID(buffer, 1);
                        results.remove(id);
                        unusedMarks.add(pos);
                        RecordLocation loc = (RecordLocation)marks.remove(id);
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                                while (m.size() > 0) {
                                    RecordLocation loc = (RecordLocation)m.first();
                                    Packet packet = journal.read(loc);
                                    RecordLocation newLoc = journal.write(packet, false);
                                    ObjectInputStream ois = new ObjectInputStream(
                                            new ByteArrayInputStream(packet.sliceAsBytes()));
                                    ois.readByte();
                                    String queue = ois.readUTF();
                                    byte[] buf = new byte[UUID_LENGTH];
                                    ois.read(buf);
                                    UUID id = new UUID(buf);
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

Examples of org.activeio.Packet.sliceAsBytes()

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.