public static final Uid unpackFrom (InputBuffer buff) throws IOException { byte[] byteForm = buff.unpackBytes(); if (byteForm == null) throw new IOException(); return new Uid(byteForm); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
public static final Uid unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IllegalArgumentException(); return new Uid(buff.unpackBytes()); }
/** * Unpack a buffer from the provided buffer, and initialise this instance * with it. If the next item in the buffer is not of the right type then an * IOException is thrown. */ public synchronized void unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IOException(tsLogger.i18NLogger.get_state_InputBuffer_11()); _valid = false; /* * unpack number of bytes, then create new byte array and unpack each * byte separately. */ _byteArray = buff.unpackBytes(); _valid = true; try { _inputStream = new ByteArrayInputStream(_byteArray); _input = new DataInputStream(_inputStream); skipHeader(); } catch (IOException e) { _valid = false; } }
/** * Unpack a buffer from the provided buffer, and initialise this instance * with it. If the next item in the buffer is not of the right type then an * IOException is thrown. */ public synchronized void unpackFrom (InputBuffer buff) throws IOException { if (buff == null) throw new IOException(tsLogger.i18NLogger.get_state_InputBuffer_11()); _valid = false; /* * unpack number of bytes, then create new byte array and unpack each * byte separately. */ _byteArray = buff.unpackBytes(); _valid = true; try { _inputStream = new ByteArrayInputStream(_byteArray); _input = new DataInputStream(_inputStream); skipHeader(); } catch (IOException e) { _valid = false; } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); Uid unpackedUid = UidHelper.unpackFrom(inputBuffer); String unpackedTypeName = inputBuffer.unpackString(); InputObjectState inputObjectState = new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); return inputObjectState; } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); Uid unpackedUid = UidHelper.unpackFrom(inputBuffer); String unpackedTypeName = inputBuffer.unpackString(); InputObjectState inputObjectState = new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); return inputObjectState; } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }