MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / write

Method write

src/main/java/core/packetproxy/gui/WrapEditorKit.java:71–90  ·  view source on GitHub ↗
(Writer out, Document doc, int pos, int len)

Source from the content-addressed store, hash-verified

69 }
70
71 @Override
72 public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException {
73 if ((pos < 0) || ((pos + len) > doc.getLength())) {
74
75 throw new BadLocationException("DefaultEditorKit.write", pos);
76 }
77
78 Segment data = new Segment();
79 int nleft = len;
80 int offs = pos;
81
82 while (nleft > 0) {
83
84 int n = Math.min(nleft, 4096);
85 doc.getText(offs, n, data);
86 out.write(data.array, data.offset, data.count);
87 offs += n;
88 nleft -= n;
89 }
90 }
91
92 class WrapColumnFactory implements ViewFactory {
93

Callers

nothing calls this directly

Calls 3

writeMethod · 0.65
getLengthMethod · 0.45
getTextMethod · 0.45

Tested by

no test coverage detected