Package java.io

Examples of java.io.DataInputStream.reset()


   
        This.fTrie = new CharTrie(dis, fTrieFoldingFunc)// Deserialize the TRIE, leaving input
                                                //  stream at an unknown position, preceding the
                                                //  padding between TRIE and following section.
   
        dis.reset();                            // Move input stream back to marked position at
                                                //   the start of the serialized TRIE.  Now our
                                                //   "pos" variable and the input stream are in
                                                //   agreement.
       
        //
View Full Code Here


        {
            return null; // eof
        }

        // reset and read the integer
        dis.reset();
        int length = dis.readInt();
        if (logger.isDebugEnabled())
        {
            logger.debug("length: " + length);
        }
View Full Code Here

          logVersion = in.readByte();
        } catch (EOFException e) {
          available = false;
        }
        if (available) {
          in.reset();
          logVersion = in.readInt();
          if (logVersion < FSConstants.LAYOUT_VERSION) // future version
            throw new IOException(
                            "Unexpected version of the file system log file: "
                            + logVersion + ". Current version = "
View Full Code Here

          DbgLog.log("TPHdr","data : " + "bytes " + umsgSizeInBytes + ", blknum " + blknum + " from " + numblks + " <" + lnkCompCode + ">");
        bytesread += umsgSizeInBytes;
        if (lockout) continue; // simulate total timeout conditions
        if (lnk.getTineProtocol() == 5)
        { // go back to the mark
          ds.reset();
          dTimeStampUSEC = (int)Swap.Short(ds.readShort()) * 1000;
          dFormat = (short)ds.readByte();
          lnkCounter = (short)ds.readByte();
          dTimeStamp = Swap.Long(ds.readInt());
          lnkStarttime = Swap.Long(ds.readInt());
View Full Code Here

      else
      { // a stream combines the 1st 4 bytes into the total (no reassembly)
        len = Swap.Long(ds.readInt());
        // now do some fancy footwork ...
        umsgSizeInBytes = len - 2; // keep the byte counting intact ...
        ds.reset(); // go back to the beginning and ...
        ds.readShort(); // move over the first 2 bytes
      }
      if (TLinkFactory.debugLevel > 1) DbgLog.log("TPHdr","recv : " + length + " bytes (hdr " + len + " bytes)");
      if (len < length)
      {
View Full Code Here

        if (TLinkFactory.debugLevel > 1)
          DbgLog.log("TPHdr","data : " + "bytes " + umsgSizeInBytes + ", blknum " + blknum + " from " + numblks + " <" + lnkCompCode + ">");
        bytesread += umsgSizeInBytes;
        if (lnk.getTineProtocol() == 5)
        { // go back to the mark
          ds.reset();
          dTimeStampUSEC = (int)Swap.Short(ds.readShort()) * 1000;
          dFormat = (short)ds.readByte();
          lnkCounter = (short)ds.readByte();
          dTimeStamp = Swap.Long(ds.readInt());
          lnkStarttime = Swap.Long(ds.readInt());
View Full Code Here

                smfParser.tracks = numtracks;
            }
        } finally {
            // if only reading the file format, reset the stream
            if (smfParser == null) {
                dis.reset();
            }
        }
        MidiFileFormat format = new MidiFileFormat(type, divisionType, resolution, fileLength, duration);
        return format;
    }
View Full Code Here

                            byte[] possible = new byte[match.length];
                            dis.readFully(possible);
                            assertEquals(possible, match);
                            matched = true;
                        } catch (AssertionError ex) {
                            dis.reset();
                            dis.readByte()// ignore
                        }
                    }
                }
            } else {
View Full Code Here

          aBuf = new byte[nSize];
          aIn  = new DataInputStream(new ByteArrayInputStream(aBuf));
        }
        else
        {
          aIn.reset();
        }

        // read parent ID
        rRecordStore.getRecord(nID, aBuf, 0);
View Full Code Here

            int status = dis.readUnsignedByte();
            int length = 0;
            //check running status
            if (status < 0x80) {
                status = oldStatus;
                dis.reset();
            }
            if (status >= 0xFF) {//MetaEvent
                int type = dis.readUnsignedByte();
                length = MidiUtil.readVarLength(dis);
                event = MidiUtil.createMetaEvent(type);
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.