Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6da22a1

Browse files
committed
hide unused api
1 parent 5e1b167 commit 6da22a1

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

stream.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (s *Stream) ID() uint32 {
6868
// Read implements net.Conn
6969
func (s *Stream) Read(b []byte) (n int, err error) {
7070
for {
71-
n, err = s.TryRead(b)
71+
n, err = s.tryRead(b)
7272
if err == ErrWouldBlock {
7373
if ew := s.waitRead(); ew != nil {
7474
return 0, ew
@@ -79,18 +79,8 @@ func (s *Stream) Read(b []byte) (n int, err error) {
7979
}
8080
}
8181

82-
// PeekSize returns the next size for Read
83-
func (s *Stream) PeekSize() int {
84-
s.bufferLock.Lock()
85-
defer s.bufferLock.Unlock()
86-
if len(s.buffers) > 0 {
87-
return len(s.buffers[0])
88-
}
89-
return 0
90-
}
91-
92-
// TryRead is the nonblocking version of Read
93-
func (s *Stream) TryRead(b []byte) (n int, err error) {
82+
// tryRead is the nonblocking version of Read
83+
func (s *Stream) tryRead(b []byte) (n int, err error) {
9484
if s.sess.config.Version == 2 {
9585
return s.tryReadv2(b)
9686
}

0 commit comments

Comments
 (0)