Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.DataSerializer$OutputStreamSerializer


        }
   
        revlogHeader.length(content.length, compressedLen);
       
        // XXX may be wise not to create DataSerializer for each revision, but for a file
        DataSerializer sds = new DataSerializer() {
          @Override
            public void write(byte[] data, int offset, int length) throws HgIOException {
              try {
                indexFile.write(data, offset, length);
              } catch (IOException ex) {
                throw new HgIOException("Write failure", ex, currentFile);
              }
            }
        };
        revlogHeader.serialize(sds);

        if (useUncompressedData) {
          sds.writeByte((byte) 'u');
          dataSource.serialize(sds);
        } else {
          int actualCompressedLenWritten = revlogDataZip.writeCompressedData(sds);
          if (actualCompressedLenWritten != compressedLen) {
            throw new HgInvalidStateException(String.format("Expected %d bytes of compressed data, but actually wrote %d in %s", compressedLen, actualCompressedLenWritten, filename));
          }
        }
        sds.done();
        //
        revisionSequence.add(node);
        prevRevContent.done();
        prevRevContent = new ByteArrayDataAccess(content);
      } catch (HgIOException ex) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.DataSerializer$OutputStreamSerializer

Copyright © 2018 www.massapicom. 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.