예제 #1
0
파일: MessageFile.java 프로젝트: imace/zava
 public String getRoutingKey() throws IOException {
   if (routingKeySize < 0) throw new IllegalStateException("Routing key already read");
   input.read(routingKeyBuf, 0, routingKeySize);
   String ans = new String(routingKeyBuf, 0, routingKeySize, UTF8);
   routingKeySize = -1;
   return ans;
 }
예제 #2
0
파일: MessageFile.java 프로젝트: imace/zava
 public byte[] getPayload() throws IOException {
   if (payloadSize < 0) throw new IllegalStateException("Payload already read");
   if (routingKeySize > 0) {
     input.skip(routingKeySize); // routing key was never read
     routingKeySize = -1;
   }
   byte[] buf = new byte[payloadSize];
   input.read(buf, 0, payloadSize);
   payloadSize = -1;
   return buf;
 }