MCPcopy
hub / github.com/google/brotli / writeRingBuffer

Method writeRingBuffer

java/org/brotli/dec/Decode.java:1072–1087  ·  view source on GitHub ↗
(State s)

Source from the content-addressed store, hash-verified

1070 }
1071
1072 private static int writeRingBuffer(State s) {
1073 final int toWrite = Utils.min(s.outputLength - s.outputUsed,
1074 s.ringBufferBytesReady - s.ringBufferBytesWritten);
1075 // TODO(eustas): DCHECK(toWrite >= 0)
1076 if (toWrite != 0) {
1077 Utils.copyBytes(s.output, s.outputOffset + s.outputUsed, s.ringBuffer,
1078 s.ringBufferBytesWritten, s.ringBufferBytesWritten + toWrite);
1079 s.outputUsed += toWrite;
1080 s.ringBufferBytesWritten += toWrite;
1081 }
1082
1083 if (s.outputUsed < s.outputLength) {
1084 return BROTLI_OK;
1085 }
1086 return BROTLI_OK_NEED_MORE_OUTPUT;
1087 }
1088
1089 private static int huffmanTreeGroupAllocSize(int alphabetSizeLimit, int n) {
1090 final int maxTableSize = MAX_HUFFMAN_TABLE_SIZE[(alphabetSizeLimit + 31) >> 5];

Callers 1

decompressMethod · 0.95

Calls 2

minMethod · 0.95
copyBytesMethod · 0.95

Tested by

no test coverage detected