public DirectActions() { outBytes = new DynamicByteArrayOutputStream(); limitIn = new ArrayInputStream(); }
public DirectActions() { outBytes = new DynamicByteArrayOutputStream(); limitIn = new ArrayInputStream(); }
public DirectActions() { outBytes = new DynamicByteArrayOutputStream(); limitIn = new ArrayInputStream(); }
/** * Initialize the StoredPage. * <p> * Initialize the object, ie. perform work normally perfomed in constructor. * Called by setIdentity() and createIdentity() - the Cacheable interfaces * which are used to move a page in/out of cache. **/ protected void initialize() { super.initialize(); if (rawDataIn == null) { rawDataIn = new ArrayInputStream(); checksum = new CRC32(); } if (pageData != null) rawDataIn.setData(pageData); }
/** * Initialize the StoredPage. * <p> * Initialize the object, ie. perform work normally perfomed in constructor. * Called by setIdentity() and createIdentity() - the Cacheable interfaces * which are used to move a page in/out of cache. **/ protected void initialize() { super.initialize(); if (rawDataIn == null) { rawDataIn = new ArrayInputStream(); checksum = new CRC32(); } if (pageData != null) rawDataIn.setData(pageData); }
/** * Initialize the StoredPage. * <p> * Initialize the object, ie. perform work normally perfomed in constructor. * Called by setIdentity() and createIdentity() - the Cacheable interfaces * which are used to move a page in/out of cache. **/ protected void initialize() { super.initialize(); if (rawDataIn == null) { rawDataIn = new ArrayInputStream(); checksum = new CRC32(); } if (pageData != null) rawDataIn.setData(pageData); }
/** Read the next log record from the scan. <P>MT - caller must provide synchronization (right now, it is only called in recovery to find the checkpoint log record. When this method is called by a more general audience, MT must be revisited). @param scan an opened log scan @param size estimated size of the log record @return the log operation that is the next in the scan, or null if no more log operation in the log scan @exception IOException Error reading the log file @exception StandardException Standard Derby error policy @exception ClassNotFoundException log corrupted */ protected Loggable readLogRecord(StreamLogScan scan, int size) throws IOException, StandardException, ClassNotFoundException { Loggable lop = null; ArrayInputStream logInputBuffer = new ArrayInputStream(new byte[size]); LogRecord record = scan.getNextRecord(logInputBuffer, null, 0); if (record != null) lop = record.getLoggable(); return lop; }
/** Read the next log record from the scan. <P>MT - caller must provide synchronization (right now, it is only called in recovery to find the checkpoint log record. When this method is called by a more general audience, MT must be revisited). @param scan an opened log scan @param size estimated size of the log record @return the log operation that is the next in the scan, or null if no more log operation in the log scan @exception IOException Error reading the log file @exception StandardException Standard Derby error policy @exception ClassNotFoundException log corrupted */ protected Loggable readLogRecord(StreamLogScan scan, int size) throws IOException, StandardException, ClassNotFoundException { Loggable lop = null; ArrayInputStream logInputBuffer = new ArrayInputStream(new byte[size]); LogRecord record = scan.getNextRecord(logInputBuffer, null, 0); if (record != null) lop = record.getLoggable(); return lop; }
/** Read the next log record from the scan. <P>MT - caller must provide synchronization (right now, it is only called in recovery to find the checkpoint log record. When this method is called by a more general audience, MT must be revisited). @param scan an opened log scan @param size estimated size of the log record @return the log operation that is the next in the scan, or null if no more log operation in the log scan @exception IOException Error reading the log file @exception StandardException Standard Derby error policy @exception ClassNotFoundException log corrupted */ protected Loggable readLogRecord(StreamLogScan scan, int size) throws IOException, StandardException, ClassNotFoundException { Loggable lop = null; ArrayInputStream logInputBuffer = new ArrayInputStream(new byte[size]); LogRecord record = scan.getNextRecord(logInputBuffer, null, 0); if (record != null) lop = record.getLoggable(); return lop; }
/** Make a new Logger with its own log record buffers MT - not needed for constructor */ public FileLogger(LogToFile logFactory) { this.logFactory = logFactory; logOutputBuffer = new DynamicByteArrayOutputStream(1024); // init size 1K logicalOut = new FormatIdOutputStream(logOutputBuffer); // logIn and logOutputBuffer must share the same buffer because they // combined to form an IO stream to access the same log record. // // Before each use of logIn, you must reset logIn's data to the // byte array you want to read from. // // To log a record, set logIn's data to point to logOutputBuffer's // byte array when you know you have everything you need in the output // buffer, then set limit on logIn and send it to the log operation's // doMe. // // Keep in mind the dynamic nature of the logOutputBuffer which means // it could switch buffer from underneath the logOutputBuffer on every // write. logIn = new ArrayInputStream(); logRecord = new LogRecord(); }
/** Make a new Logger with its own log record buffers MT - not needed for constructor */ public FileLogger(LogToFile logFactory) { this.logFactory = logFactory; logOutputBuffer = new DynamicByteArrayOutputStream(1024); // init size 1K logicalOut = new FormatIdOutputStream(logOutputBuffer); // logIn and logOutputBuffer must share the same buffer because they // combined to form an IO stream to access the same log record. // // Before each use of logIn, you must reset logIn's data to the // byte array you want to read from. // // To log a record, set logIn's data to point to logOutputBuffer's // byte array when you know you have everything you need in the output // buffer, then set limit on logIn and send it to the log operation's // doMe. // // Keep in mind the dynamic nature of the logOutputBuffer which means // it could switch buffer from underneath the logOutputBuffer on every // write. logIn = new ArrayInputStream(); logRecord = new LogRecord(); }
/** Make a new Logger with its own log record buffers MT - not needed for constructor */ public FileLogger(LogToFile logFactory) { this.logFactory = logFactory; logOutputBuffer = new DynamicByteArrayOutputStream(1024); // init size 1K logicalOut = new FormatIdOutputStream(logOutputBuffer); // logIn and logOutputBuffer must share the same buffer because they // combined to form an IO stream to access the same log record. // // Before each use of logIn, you must reset logIn's data to the // byte array you want to read from. // // To log a record, set logIn's data to point to logOutputBuffer's // byte array when you know you have everything you need in the output // buffer, then set limit on logIn and send it to the log operation's // doMe. // // Keep in mind the dynamic nature of the logOutputBuffer which means // it could switch buffer from underneath the logOutputBuffer on every // write. logIn = new ArrayInputStream(); logRecord = new LogRecord(); }
throws StandardException, IOException ArrayInputStream inStream = new ArrayInputStream(a);
throws StandardException, IOException ArrayInputStream inStream = new ArrayInputStream(a);
throws StandardException, IOException ArrayInputStream inStream = new ArrayInputStream(a);
ArrayInputStream inStream = new ArrayInputStream(array);
ArrayInputStream inStream = new ArrayInputStream(array);
ArrayInputStream inStream = new ArrayInputStream(array);
(StreamLogScan) openForwardsScan(startInstant, (LogInstant)null); ArrayInputStream scanInputStream = new ArrayInputStream(); while(scanOfHighestLogFile.getNextRecord(scanInputStream, null, 0) != null){
(StreamLogScan) openForwardsScan(startInstant, (LogInstant)null); ArrayInputStream scanInputStream = new ArrayInputStream(); while(scanOfHighestLogFile.getNextRecord(scanInputStream, null, 0) != null){