Package java.io

Examples of java.io.ObjectInputStream.readFully()


        }
        break;

      case TAKE_OP:
        cookie = new byte[16];
        in.readFully(cookie);
        txnId = (Long)in.readObject();
        opOn.takeOp(cookie, txnId);
        break;

      case BATCH_TAKE_OP:
View Full Code Here


      case BATCH_TAKE_OP:
        txnId = (Long)in.readObject();
        count = in.readInt();
        for (int i=0; i<count; i++) {
      cookie = new byte[16];
      in.readFully(cookie);
      opOn.takeOp(cookie, txnId);
        }
        break;

      case REGISTER_OP:
View Full Code Here

        opOn.registerOp(registration);
        break;

      case RENEW_OP:
        cookie = new byte[16];
        in.readFully(cookie);
        long expires = in.readLong();
        opOn.renewOp(cookie, expires);
        break;

      case CANCEL_OP:
View Full Code Here

        opOn.renewOp(cookie, expires);
        break;

      case CANCEL_OP:
        cookie = new byte[16];
        in.readFully(cookie);
        opOn.cancelOp(cookie);
        break;

      case PREPARE_OP:
        txnId = (Long)in.readObject();
View Full Code Here

        opOn.abortOp(txnId);
        break;

      case UUID_OP:
        final byte uuid[] = new byte[16];
        in.readFully(uuid);
        opOn.uuidOp(uuid);
        break;

      default:
                    failure("log record corrupted, unknown opcode");
View Full Code Here

        if (i > 10 && i % (1000000 / 10) == 0)
          System.out.print(".");

        buffer = new byte[size];
        oiStream.readFully(buffer);
        transferred += size;

        ooStream.writeByte(0);
        ooStream.flush();
        oStream.flush();
View Full Code Here

    private BigInteger readBigInteger(final InputStream in) throws Exception {
        ObjectInputStream objectInput = new ObjectInputStream(in);
        int lengthOfBigInt = objectInput.readInt();
        byte[] bigIntBytes = new byte[lengthOfBigInt];
        objectInput.readFully(bigIntBytes);
        return new BigInteger(bigIntBytes);
    }

    /**
     * Returns the symmetric key as a {@link SecretKey}.
View Full Code Here

                final int dataLen = ois.readInt();
                if (dataLen == -1)
                    data = null;
                else {
                    data = new byte[dataLen];
                    ois.readFully(data);
                }
                children = (Map<String, byte[]>) ois.readObject();
            } catch (IOException e) {
                throw new AssertionError(e);
            } catch (ClassNotFoundException e) {
View Full Code Here

                final int dataLen = ois.readInt();
                if (dataLen == -1)
                    data = null;
                else {
                    data = new byte[dataLen];
                    ois.readFully(data);
                }
                children = (Map<String, byte[]>) ois.readObject();
            } catch (IOException e) {
                throw new AssertionError(e);
            } catch (ClassNotFoundException e) {
View Full Code Here

      for( int j = 0; j < mapSize; j++ )
        {
        String key = in.readUTF();
        byte[] valBytes = new byte[ in.readInt() ];
        in.readFully( valBytes );
        map.put( key, deserialize( valBytes, tClass, false ) );
        }

      return map;
      }
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.