Package java.io

Examples of java.io.DataOutputStream.writeShort()


                dos.writeInt(encodedBasicSettings.length - checksumLength);
                byte[] bufToWrite = baos.toByteArray();
                baos = new ByteArrayOutputStream();
                dos = new DataOutputStream(baos);
                dos.writeInt(0); // flags
                dos.writeShort(checksumChecker.getChecksumTypeID());
                dos.writeInt(VERSION);
                byte[] version = baos.toByteArray();
                byte[] bufToChecksum = Arrays.copyOf(bufToWrite, bufToWrite.length+version.length);
                System.arraycopy(version, 0, bufToChecksum, bufToWrite.length, version.length);
                byte[] checksum =
View Full Code Here


    private byte[] innerEncodeBasicSettings(int totalDataBlocks, int totalCheckBlocks,
            int totalCrossCheckBlocks) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(baos);
        try {
            dos.writeShort(splitfileType.code);
            dos.writeByte(this.splitfileSingleCryptoAlgorithm);
            dos.writeBoolean(this.splitfileSingleCryptoKey != null);
            if(this.splitfileSingleCryptoKey != null) {
                assert(splitfileSingleCryptoKey.length == 32);
                dos.write(splitfileSingleCryptoKey);
View Full Code Here

            dos.writeLong(this.finalLength);
            dos.writeLong(this.decompressedLength);
            clientMetadata.writeTo(dos);
            dos.writeInt(decompressors.size()); // FIXME enforce size limits???
            for(COMPRESSOR_TYPE c : decompressors)
                dos.writeShort(c.metadataID);
            dos.writeLong(offsetKeyList);
            dos.writeLong(offsetSegmentStatus);
            dos.writeLong(offsetGeneralProgress);
            dos.writeLong(offsetMainBloomFilter);
            dos.writeLong(offsetSegmentBloomFilters);
View Full Code Here

            dos = new DataOutputStream(os);
            dos.writeInt(VERSION);
            originalData.storeTo(dos);
            dos.writeInt(totalDataBlocks);
            dos.writeInt(totalCheckBlocks);
            dos.writeShort(splitfileType.code); // And hence the FECCodec
            dos.writeLong(dataLength);
            dos.writeLong(decompressedLength);
            dos.writeBoolean(isMetadata);
            if(archiveType == null)
                dos.writeShort((short) -1);
View Full Code Here

            dos.writeShort(splitfileType.code); // And hence the FECCodec
            dos.writeLong(dataLength);
            dos.writeLong(decompressedLength);
            dos.writeBoolean(isMetadata);
            if(archiveType == null)
                dos.writeShort((short) -1);
            else
                dos.writeShort(archiveType.metadataID);
            clientMetadata.writeTo(dos);
            if (compressionCodec == null)
                dos.writeShort((short) -1);
View Full Code Here

            dos.writeLong(decompressedLength);
            dos.writeBoolean(isMetadata);
            if(archiveType == null)
                dos.writeShort((short) -1);
            else
                dos.writeShort(archiveType.metadataID);
            clientMetadata.writeTo(dos);
            if (compressionCodec == null)
                dos.writeShort((short) -1);
            else
                dos.writeShort(compressionCodec.metadataID);
View Full Code Here

                dos.writeShort((short) -1);
            else
                dos.writeShort(archiveType.metadataID);
            clientMetadata.writeTo(dos);
            if (compressionCodec == null)
                dos.writeShort((short) -1);
            else
                dos.writeShort(compressionCodec.metadataID);
            dos.writeInt(segments.length);
            dos.writeInt(segmentSize);
            dos.writeInt(checkSegmentSize);
View Full Code Here

                dos.writeShort(archiveType.metadataID);
            clientMetadata.writeTo(dos);
            if (compressionCodec == null)
                dos.writeShort((short) -1);
            else
                dos.writeShort(compressionCodec.metadataID);
            dos.writeInt(segments.length);
            dos.writeInt(segmentSize);
            dos.writeInt(checkSegmentSize);
            dos.writeInt(crossCheckBlocks);
            dos.writeByte(this.splitfileCryptoAlgorithm);
View Full Code Here

      int blockLength;
      if(markerType == MARKER_EOI || markerType >= MARKER_RST0 && markerType <= MARKER_RST7)
        blockLength = 0;
      else {
        blockLength = dis.readUnsignedShort();
        dos.writeShort(blockLength);
      }
      if(markerType == 0xDA) {
        // Start of scan marker

        // Copy marker
View Full Code Here

          dos.write(minorVersion);
          int units = dis.readUnsignedByte();
          if(units > 2)
            throwError("Invalid header", "Unrecognized units type "+units+".");
          dos.write(units);
          dos.writeShort(dis.readShort()); // Copy Xdensity
          dos.writeShort(dis.readShort()); // Copy Ydensity
          int thumbX = dis.readUnsignedByte();
          dos.writeByte(thumbX);
          int thumbY = dis.readUnsignedByte();
          dos.writeByte(thumbY);
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.