Toggle navigation
Home
java.io.Writer to com.google.common.io.GwtWorkarounds.CharOutput
No. of Instances - 3
No. of Commits - 1
No. of Projects - {'guava'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> Internal
Mapping:
Cascading Type Change (Different)
OutputStream
to
ByteOutput
Update Anonymous class
{ int bitBuffer=0; int bitBufferLength=0; int writtenChars=0; @Override public void write( int b) throws IOException { bitBuffer<<=8; bitBuffer|=b & 0xFF; bitBufferLength+=8; while (bitBufferLength >= alphabet.bitsPerChar) { int charIndex=(bitBuffer >> (bitBufferLength - alphabet.bitsPerChar)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; bitBufferLength-=alphabet.bitsPerChar; } } @Override public void flush() throws IOException { out.flush(); } @Override public void close() throws IOException { if (bitBufferLength > 0) { int charIndex=(bitBuffer << (alphabet.bitsPerChar - bitBufferLength)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; if (paddingChar != null) { while (writtenChars % alphabet.charsPerChunk != 0) { out.write(paddingChar.charValue()); writtenChars++; } } } out.close(); } }
to
{ int bitBuffer=0; int bitBufferLength=0; int writtenChars=0; @Override public void write( byte b) throws IOException { bitBuffer<<=8; bitBuffer|=b & 0xFF; bitBufferLength+=8; while (bitBufferLength >= alphabet.bitsPerChar) { int charIndex=(bitBuffer >> (bitBufferLength - alphabet.bitsPerChar)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; bitBufferLength-=alphabet.bitsPerChar; } } @Override public void flush() throws IOException { out.flush(); } @Override public void close() throws IOException { if (bitBufferLength > 0) { int charIndex=(bitBuffer << (alphabet.bitsPerChar - bitBufferLength)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; if (paddingChar != null) { while (writtenChars % alphabet.charsPerChunk != 0) { out.write(paddingChar.charValue()); writtenChars++; } } } out.close(); } }
Add or Remove Method invocation
separatingWriter(output,separator,afterEveryChars)
to
separatingOutput(output,separator,afterEveryChars)