/// <exception cref="System.IO.IOException"></exception> private void FmtOverflowBuffer(byte[] nameBuf, int namePos, int nameLen, FileMode mode) { if (buf != null) { overflowBuffer = new TemporaryBuffer.Heap(int.MaxValue); overflowBuffer.Write(buf, 0, ptr); buf = null; } mode.CopyTo(overflowBuffer); overflowBuffer.Write(unchecked ((byte)' ')); overflowBuffer.Write(nameBuf, namePos, nameLen); overflowBuffer.Write(unchecked ((byte)0)); }
private bool FmtBuf(byte[] nameBuf, int namePos, int nameLen, FileMode mode) { if (buf == null || buf.Length < ptr + EntrySize(mode, nameLen)) { return(false); } mode.CopyTo(buf, ptr); ptr += mode.CopyToLength(); buf[ptr++] = (byte)(' '); System.Array.Copy(nameBuf, namePos, buf, ptr, nameLen); ptr += nameLen; buf[ptr++] = 0; return(true); }
/// <exception cref="System.IO.IOException"></exception> private void FmtOverflowBuffer(byte[] nameBuf, int namePos, int nameLen, FileMode mode) { if (buf != null) { overflowBuffer = new TemporaryBuffer.Heap(int.MaxValue); overflowBuffer.Write(buf, 0, ptr); buf = null; } mode.CopyTo(overflowBuffer); overflowBuffer.Write(unchecked((byte)' ')); overflowBuffer.Write(nameBuf, namePos, nameLen); overflowBuffer.Write(unchecked((byte)0)); }
/// <exception cref="System.Exception"></exception> private static byte[] Entry(FileMode mode, string name, ObjectId id) { ByteArrayOutputStream @out = new ByteArrayOutputStream(); mode.CopyTo(@out); @out.Write(' '); @out.Write(Constants.Encode(name)); @out.Write(0); id.CopyRawTo(@out); return @out.ToByteArray(); }
private bool FmtBuf(byte[] nameBuf, int namePos, int nameLen, FileMode mode) { if (buf == null || buf.Length < ptr + EntrySize(mode, nameLen)) { return false; } mode.CopyTo(buf, ptr); ptr += mode.CopyToLength(); buf[ptr++] = (byte)(' '); System.Array.Copy(nameBuf, namePos, buf, ptr, nameLen); ptr += nameLen; buf[ptr++] = 0; return true; }